I don't understand why FreeBSD doesn't see isnan() after including math.h
but it doesn't. Trying the apple approach to fixing isnan results in an infinite loop (making me wonder what happens on OSX?) This is an alternative approach to checking isnan() on freebsd ...
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
# include <AL/alc.h>
|
||||
#endif
|
||||
|
||||
#if defined (__APPLE__)
|
||||
#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); }
|
||||
@@ -46,6 +46,10 @@ 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
|
||||
|
||||
#include STL_IOSTREAM
|
||||
|
||||
#include <simgear/debug/logstream.hxx>
|
||||
|
||||
Reference in New Issue
Block a user