bug 682319 - use C99 isfinite on OS X, since finite is deprecated (and not present on iOS). r=bz
authorTed Mielczarek <ted.mielczarek@gmail.com>
Mon, 29 Aug 2011 11:14:27 -0400
changeset 76277 80b591f7b1356da54b035c9463e41720ba066245
parent 76276 4613ef36f288e9e310c19ebdbd0afed4d0afc3bf
child 76278 14497b5c651ee7c44323d85243b0261d422b7a9f
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersbz
bugs682319
milestone9.0a1
bug 682319 - use C99 isfinite on OS X, since finite is deprecated (and not present on iOS). r=bz
xpcom/ds/nsMathUtils.h
--- a/xpcom/ds/nsMathUtils.h
+++ b/xpcom/ds/nsMathUtils.h
@@ -125,14 +125,18 @@ inline NS_HIDDEN_(double) NS_hypot(doubl
  * Check whether a floating point number is finite (not +/-infinity and not a
  * NaN value).
  */
 inline NS_HIDDEN_(bool) NS_finite(double d)
 {
 #ifdef WIN32
     // NOTE: '!!' casts an int to bool without spamming MSVC warning C4800.
     return !!_finite(d);
+#elif defined(XP_DARWIN)
+    // Darwin has deprecated |finite| and recommends |isfinite|. The former is
+    // not present in the iOS SDK.
+    return isfinite(d);
 #else
     return finite(d);
 #endif
 }
 
 #endif