diff options
-rw-r--r-- | sal/inc/sal/mathconf.h | 10 |
1 files changed, 9 insertions, 1 deletions
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 <cmath> has been + * included which #undefs isfinite: copy the definition of isfinite() + * from <architecture/arm/math.h> + */ +#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 */ |