|
From: <kw...@us...> - 2006-05-15 15:54:35
|
Revision: 958 Author: kwizatz Date: 2006-05-15 08:54:26 -0700 (Mon, 15 May 2006) ViewCVS: http://svn.sourceforge.net/opende/?rev=958&view=rev Log Message: ----------- Fixed isnanf issue on MinGW Modified Paths: -------------- trunk/configure.in trunk/include/ode/common.h Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2006-05-12 16:35:33 UTC (rev 957) +++ trunk/configure.in 2006-05-15 15:54:26 UTC (rev 958) @@ -354,7 +354,7 @@ fi dnl Check for autoscan sugested functions -AC_CHECK_FUNCS([floor memmove memset select sqrt sqrtf sinf cosf fabsf atan2f fmodf copysignf copysign snprintf vsnprintf gettimeofday isnan isnanf]) +AC_CHECK_FUNCS([floor memmove memset select sqrt sqrtf sinf cosf fabsf atan2f fmodf copysignf copysign snprintf vsnprintf gettimeofday isnan isnanf _isnan _isnanf __isnan __isnanf]) AC_FUNC_ALLOCA AC_FUNC_MALLOC AC_FUNC_OBSTACK Modified: trunk/include/ode/common.h =================================================================== --- trunk/include/ode/common.h 2006-05-12 16:35:33 UTC (rev 957) +++ trunk/include/ode/common.h 2006-05-15 15:54:26 UTC (rev 958) @@ -130,7 +130,26 @@ #define dFabs(x) (fabsf(x)) /* absolute value */ #define dAtan2(y,x) (atan2f(y,x)) /* arc tangent with 2 args */ #define dFMod(a,b) (fmodf(a,b)) /* modulo */ + +#ifdef HAVE___ISNANF +#define dIsNan(x) (__isnanf(x)) +#elif defined(HAVE__ISNANF) +#define dIsNan(x) (_isnanf(x)) +#elif defined(HAVE_ISNANF) #define dIsNan(x) (isnanf(x)) +#else + /* + fall back to _isnanf which is the VC way, + this may seem redundant since we already checked + for _isnan before, but if isnan is detected by + configure but is not found during compilation + we should always make sure we check for __isnanf, + _isnan and isnan in that order before falling + back to a default + */ +#define dIsNan(x) (_isnanf(x)) +#endif + #define dCopySign(a,b) ((dReal)copysignf(a,b)) #elif defined(dDOUBLE) @@ -144,7 +163,16 @@ #define dFabs(x) fabs(x) #define dAtan2(y,x) atan2((y),(x)) #define dFMod(a,b) (fmod((a),(b))) +#ifdef HAVE___ISNAN +#define dIsNan(x) (__isnan(x)) +#elif defined(HAVE__ISNAN) +#define dIsNan(x) (_isnan(x)) +#elif defined(HAVE_ISNAN) #define dIsNan(x) (isnan(x)) +#else +#define dIsNan(x) (_isnan(x)) +#endif + #define dCopySign(a,b) (copysign((a),(b))) #else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |