From b6dffaf8f81ef07e048089eccda272750984d944 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 14 Jun 2011 01:48:29 +0300 Subject: Fix SAL_MATH_FINITE definition for iOS --- sal/inc/sal/mathconf.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sal/inc/sal/mathconf.h b/sal/inc/sal/mathconf.h index f32b2d6c8d6c..d673f34ed473 100644 --- a/sal/inc/sal/mathconf.h +++ b/sal/inc/sal/mathconf.h @@ -62,7 +62,15 @@ extern "C" { #if defined( WNT) #define SAL_MATH_FINITE(d) _finite(d) #elif defined IOS -#define SAL_MATH_FINITE(d) isfinite(d) +/* C++ is so nice. This is the only way I could come up with making + * this actually work in all cases (?), even when has been + * included which #undefs isfinite: copy the definition of isfinite() + * from + */ +#define SAL_MATH_FINITE(d) \ + ( sizeof (d) == sizeof(float ) ? __inline_isfinitef((float)(d)) \ + : sizeof (d) == sizeof(double) ? __inline_isfinited((double)(d)) \ + : __inline_isfinite ((long double)(d))) #elif defined LINUX || defined UNX #define SAL_MATH_FINITE(d) finite(d) #else /* WNT, LINUX, UNX */ -- cgit