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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_FLOAT_UTIL_H_ 5 #ifndef BASE_FLOAT_UTIL_H_
6 #define BASE_FLOAT_UTIL_H_ 6 #define BASE_FLOAT_UTIL_H_
7 #pragma once 7 #pragma once
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 10
11 #include <float.h> 11 #include <float.h>
12 #include <math.h> 12 #include <math.h>
13 13
14 #if defined(OS_SOLARIS) 14 #if defined(OS_SOLARIS)
15 #include <ieeefp.h> 15 #include <ieeefp.h>
16 #endif 16 #endif
17 17
18 namespace base { 18 namespace base {
19 19
20 inline bool IsFinite(const double& number) { 20 inline bool IsFinite(const double& number) {
21 #if defined(OS_POSIX) 21 #if defined(OS_MACOSX)
22 // C99 says isfinite() replaced finite(), and iOS does not provide the
23 // older call.
24 return isfinite(number) != 0;
25 #elif defined(OS_POSIX)
22 return finite(number) != 0; 26 return finite(number) != 0;
Mark Mentovai 2012/07/10 12:19:29 If you’re afraid to change this, and I’m not, but
23 #elif defined(OS_WIN) 27 #elif defined(OS_WIN)
24 return _finite(number) != 0; 28 return _finite(number) != 0;
25 #endif 29 #endif
26 } 30 }
27 31
28 } // namespace base 32 } // namespace base
29 33
30 #endif // BASE_FLOAT_UTIL_H_ 34 #endif // BASE_FLOAT_UTIL_H_
OLDNEW
« 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