Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(497)

Unified Diff: base/float_util.h

Issue 10704126: Use isfinite instead of finite on Mac (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Comment fix Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/float_util.h
diff --git a/base/float_util.h b/base/float_util.h
index 69334d09bf1749d10b4c53bb7a03ecd4f54ae92c..2a03023726012c492c4e8613dd7775fc119edbab 100644
--- a/base/float_util.h
+++ b/base/float_util.h
@@ -18,7 +18,11 @@
namespace base {
inline bool IsFinite(const double& number) {
-#if defined(OS_POSIX)
+#if defined(OS_MACOSX)
+ // C99 says isfinite() replaced finite(), and iOS does not provide the
+ // older call.
+ return isfinite(number) != 0;
+#elif defined(OS_POSIX)
return finite(number) != 0;
Mark Mentovai 2012/07/10 12:19:29 If you’re afraid to change this, and I’m not, but
#elif defined(OS_WIN)
return _finite(number) != 0;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698