1 #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 20 #ifndef HAVE_DECL_NAN 21 #error This platform does not have nan() 22 #endif 23 24 #ifndef HAVE_DECL_INFINITY 25 #error This platform does not have INFINITY 26 #endif 27 28 #endif 29