Bug 1320560 - Use C99 math isfinite, finite has been depreciated and all modern libc implementations use isfinite. r=froydnj
authorJory A. Pratt <anarchy@gentoo.org>
Sun, 08 Jan 2017 11:34:00 -0500
changeset 376580 4723934741c5
parent 376579 b3fb981d0e10
child 376581 704b352ba3be
push id32387
push userryanvm@gmail.com
push dateFri, 25 Aug 2017 00:13:42 +0000
treeherdermozilla-central@3199bacd6b38 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1320560
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1320560 - Use C99 math isfinite, finite has been depreciated and all modern libc implementations use isfinite. r=froydnj
xpcom/ds/nsMathUtils.h
--- a/xpcom/ds/nsMathUtils.h
+++ b/xpcom/ds/nsMathUtils.h
@@ -98,22 +98,18 @@ NS_hypot(double aNum1, double aNum2)
  * NaN value).
  */
 inline bool
 NS_finite(double aNum)
 {
 #ifdef WIN32
   // NOTE: '!!' casts an int to bool without spamming MSVC warning C4800.
   return !!_finite(aNum);
-#elif defined(XP_DARWIN)
-  // Darwin has deprecated |finite| and recommends |isfinite|. The former is
-  // not present in the iOS SDK.
+#else
   return std::isfinite(aNum);
-#else
-  return finite(aNum);
 #endif
 }
 
 /**
  * Returns the result of the modulo of x by y using a floored division.
  * fmod(x, y) is using a truncated division.
  * The main difference is that the result of this method will have the sign of
  * y while the result of fmod(x, y) will have the sign of x.