Eric Haszlakiewicz | e6f1322 | 2014-03-02 12:16:37 -0500 | [diff] [blame] | 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 | |
Eric Haszlakiewicz | 0eedf38 | 2014-03-09 16:41:33 -0400 | [diff] [blame] | 20 | #ifndef HAVE_DECL_NAN |
| 21 | #error This platform does not have nan() |
| 22 | #endif |
| 23 | |
Eric Haszlakiewicz | 05da316 | 2014-03-22 17:28:40 -0400 | [diff] [blame] | 24 | #ifndef HAVE_DECL_INFINITY |
| 25 | #error This platform does not have INFINITY |
| 26 | #endif |
| 27 | |
Eric Haszlakiewicz | e6f1322 | 2014-03-02 12:16:37 -0500 | [diff] [blame] | 28 | #endif |