Added #define DARWIN_OSX_PRE_10_2 and related #ifdef checks to cope with backwards compatiblity
with versions of OSX before 10.2.
This commit is contained in:
parent
9816a51bc7
commit
aca6c3c4f9
@ -7,6 +7,11 @@
|
|||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
// 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)
|
#if defined(_MSC_VER) && (_MSC_VER >= 1300)
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
#endif
|
#endif
|
||||||
@ -70,7 +75,7 @@
|
|||||||
#if (defined(WIN32) && !(defined(_MSC_VER) && (_MSC_VER >= 1300)) && !defined(__MINGW32__) ) || \
|
#if (defined(WIN32) && !(defined(_MSC_VER) && (_MSC_VER >= 1300)) && !defined(__MINGW32__) ) || \
|
||||||
defined (sun) || \
|
defined (sun) || \
|
||||||
defined (__hpux__) || \
|
defined (__hpux__) || \
|
||||||
defined (__DARWIN_OSX__)
|
defined (DARWIN_OSX_PRE_10_2)
|
||||||
|
|
||||||
#ifndef floorf
|
#ifndef floorf
|
||||||
#define floorf (float)floor
|
#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(float v) { return _isnan(v)!=0; }
|
||||||
inline bool isNaN(double v) { return _isnan(v)!=0; }
|
inline bool isNaN(double v) { return _isnan(v)!=0; }
|
||||||
#else
|
#else
|
||||||
// coment out this special handling for OSX, no longer seems valid.
|
# if defined(__DARWIN_OSX__) && !defined (DARWIN_OSX_PRE_10_2)
|
||||||
// # if defined(__DARWIN_OSX__)
|
inline bool isNaN(float v) { return __isnanf(v); }
|
||||||
// inline bool isNaN(float v) { return __isnanf(v); }
|
inline bool isNaN(double v) { return __isnand(v); }
|
||||||
// inline bool isNaN(double v) { return __isnand(v); }
|
#else
|
||||||
// #else
|
inline bool isNaN(float v) { return isnan(v); }
|
||||||
inline bool isNaN(float v) { return isnan(v); }
|
inline bool isNaN(double v) { return isnan(v); }
|
||||||
inline bool isNaN(double v) { return isnan(v); }
|
#endif
|
||||||
// #endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user