From aca6c3c4f98e9c33b89bc5c07804617bcf36a14e Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 8 Nov 2002 12:26:41 +0000 Subject: [PATCH] Added #define DARWIN_OSX_PRE_10_2 and related #ifdef checks to cope with backwards compatiblity with versions of OSX before 10.2. --- include/osg/Math | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/include/osg/Math b/include/osg/Math index 146d3d637..06a24b24e 100644 --- a/include/osg/Math +++ b/include/osg/Math @@ -7,6 +7,11 @@ #include +// for OSX users : +// comment in if you want backwards compatibility with 10.1.x versions +// otherwise you'll have problems with missing floorf and __isnan*() +// #define DARWIN_OSX_PRE_10_2 + #if defined(_MSC_VER) && (_MSC_VER >= 1300) #include #endif @@ -70,7 +75,7 @@ #if (defined(WIN32) && !(defined(_MSC_VER) && (_MSC_VER >= 1300)) && !defined(__MINGW32__) ) || \ defined (sun) || \ defined (__hpux__) || \ - defined (__DARWIN_OSX__) + defined (DARWIN_OSX_PRE_10_2) #ifndef floorf #define floorf (float)floor @@ -124,14 +129,13 @@ inline double RadiansToDegrees(double angle) { return angle*180.0/PI; } inline bool isNaN(float v) { return _isnan(v)!=0; } inline bool isNaN(double v) { return _isnan(v)!=0; } #else -// coment out this special handling for OSX, no longer seems valid. -// # if defined(__DARWIN_OSX__) -// inline bool isNaN(float v) { return __isnanf(v); } -// inline bool isNaN(double v) { return __isnand(v); } -// #else - inline bool isNaN(float v) { return isnan(v); } - inline bool isNaN(double v) { return isnan(v); } -// #endif + # if defined(__DARWIN_OSX__) && !defined (DARWIN_OSX_PRE_10_2) + inline bool isNaN(float v) { return __isnanf(v); } + inline bool isNaN(double v) { return __isnand(v); } + #else + inline bool isNaN(float v) { return isnan(v); } + inline bool isNaN(double v) { return isnan(v); } + #endif #endif