A better fix for isnan() and isinf() on Windows.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 29 Jan 2015 12:48:46 +0000 (14:48 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 29 Jan 2015 12:50:00 +0000 (14:50 +0200)
Newer versions of Visual Studio actually have isnan() and isinf() macros.
Silence compiler warnings about redefining them.

test/src/result-conversions-test.c

index 9da6d0960b34cf6747e6bda02c4a24c1ff7414be..2ca52fb4323ab17cd49a9af80cf5a97351f557e4 100644 (file)
 
 #include "common.h"
 
-#ifdef WIN32
+#if defined(WIN32) && !defined(isnan)
 #define isnan(x)   _isnan(x)
+#endif
+#if defined(WIN32) && !defined(isinf)
 #define isinf(x)   ((_fpclass(x) == _FPCLASS_PINF) || \
                     (_fpclass(x) == _FPCLASS_NINF))
 #endif