blob: 11bd2d802d9387b91c466584550cb7734820be98 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# HG changeset patch
# User Jory A. Pratt <anarchy@gentoo.org>
# Date 1483893240 18000
# Node ID 4723934741c51affa834f6866ca5fe5c419ddfe8
# Parent b3fb981d0e10bcae8c73f6be6856fea266b30017
Bug 1320560 - Use C99 math isfinite, finite has been depreciated and all modern libc implementations use isfinite. r=froydnj
diff --git a/xpcom/ds/nsMathUtils.h b/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.
|