blob: d94a4dacfd48513cc5a1e7bbd8ecec21d87a12d1 [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 Haszlakiewicze6f13222014-03-02 12:16:37 -050024#endif