]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/sky/cloud.cxx
I don't understand why FreeBSD doesn't see isnan() after including math.h
[simgear.git] / simgear / scene / sky / cloud.cxx
index a2b3b66237ed36fd1452e4c7f80ce71e0d077977..e62384b90922e98f2cacc87f1c7250a2fa242aad 100644 (file)
@@ -21,7 +21,7 @@
 // #include <stdio.h>
 #include <math.h>
 
-#if defined (__APPLE__) || defined (__FreeBSD__)
+#if defined (__APPLE__)
 // any C++ header file undefines isinf and isnan
 // so this should be included before <iostream>
 inline int (isinf)(double r) { return isinf(r); }
@@ -45,6 +45,11 @@ inline int (isnan)(double r) { return isnan(r); }
 #define isnan(x) _isnan(x)
 #endif
 
+#if defined (__FreeBSD__)
+inline int isnan(double r) { return !(r < 0 || r > 0); }
+#endif
+
+
 
 static ssgStateSelector *layer_states[SGCloudLayer::SG_MAX_CLOUD_COVERAGES];
 static bool state_initialized = false;