blob: f40b8faf8fd4202e859cf43d1b3daaaccdba7c0d [file] [log] [blame]
Eric Haszlakiewicze6f13222014-03-02 12:16:37 -05001#ifndef __math_compat_h
2#define __math_compat_h
3
4/* Define isnan and isinf on Windows/MSVC */
5
6#ifndef HAVE_DECL_ISNAN
7# ifdef HAVE_DECL__ISNAN
8#include <float.h>
9#define isnan(x) _isnan(x)
10# endif
11#endif
12
13#ifndef HAVE_DECL_ISINF
14# ifdef HAVE_DECL__FINITE
15#include <float.h>
16#define isinf(x) (!_finite(x))
17# endif
18#endif
19
Eric Haszlakiewicz0eedf382014-03-09 16:41:33 -040020#ifndef HAVE_DECL_NAN
21#error This platform does not have nan()
22#endif
23
Eric Haszlakiewicz05da3162014-03-22 17:28:40 -040024#ifndef HAVE_DECL_INFINITY
25#error This platform does not have INFINITY
26#endif
27
Eric Haszlakiewicze6f13222014-03-02 12:16:37 -050028#endif