You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by hd...@apache.org on 2013/05/21 14:45:44 UTC

svn commit: r1484783 - /openoffice/trunk/main/sal/inc/sal/mathconf.h

Author: hdu
Date: Tue May 21 12:45:44 2013
New Revision: 1484783

URL: http://svn.apache.org/r1484783
Log:
prefer standard isfinite()

which should be available in math.h according to C99, C++99, SUSv3, etc.
unless GCC bug 14608 hits us where cmath undefines isfinite as macro

Modified:
    openoffice/trunk/main/sal/inc/sal/mathconf.h

Modified: openoffice/trunk/main/sal/inc/sal/mathconf.h
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sal/inc/sal/mathconf.h?rev=1484783&r1=1484782&r2=1484783&view=diff
==============================================================================
--- openoffice/trunk/main/sal/inc/sal/mathconf.h (original)
+++ openoffice/trunk/main/sal/inc/sal/mathconf.h Tue May 21 12:45:44 2013
@@ -27,6 +27,7 @@
 #include "osl/endian.h"
 
 #include <float.h>
+#include <math.h>
 
 #if defined SOLARIS
 #include <ieeefp.h>
@@ -54,7 +55,13 @@ extern "C" {
 
 
 /* SAL_MATH_FINITE(d): test double d on INFINITY, NaN et al. */
-#if defined( WNT)
+#if defined(__GNUC__)
+	#define SAL_MATH_FINITE(d) __builtin_isfinite(d) // gcc bug 14608
+#elif defined(__STDC__)
+	// isfinite() should be available in math.h according to C99,C++99,SUSv3,etc.
+	// unless GCC bug 14608 hits us where cmath undefines isfinite as macro
+    #define SAL_MATH_FINITE(d) isfinite(d)
+#elif defined( WNT)
 #define SAL_MATH_FINITE(d) _finite(d)
 #elif defined OS2
 #define SAL_MATH_FINITE(d) finite(d)