// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef BASE_FLOAT_UTIL_H_
#define BASE_FLOAT_UTIL_H_
#pragma once

#include "build/build_config.h"

#include <float.h>
#include <math.h>

#if defined(OS_SOLARIS)
#include <ieeefp.h>
#endif

namespace base {

inline bool IsFinite(const double& number) {
#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;
#elif defined(OS_WIN)
  return _finite(number) != 0;
#endif
}

}  // namespace base

#endif  // BASE_FLOAT_UTIL_H_

// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef BASE_FLOAT_UTIL_H_
#define BASE_FLOAT_UTIL_H_
#pragma once

#include "build/build_config.h"

#include <float.h>
#include <math.h>

#if defined(OS_SOLARIS)
#include <ieeefp.h>
#endif

namespace base {

inline bool IsFinite(const double& number) {
#if defined(OS_POSIX)
  return finite(number) != 0;
#elif defined(OS_WIN)
  return _finite(number) != 0;
#endif
}

}  // namespace base

#endif  // BASE_FLOAT_UTIL_H_

--- 
+++ 
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
@@ -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;
 #elif defined(OS_WIN)
   return _finite(number) != 0;
Use isfinite instead of finite on Mac

According to math.h in the 10.6 SDK, finite is deprecated in favor of isfinite, and finite isn't available on iOS.

BUG=None
TEST=None


Review URL: https://chromiumcodereview.appspot.com/10704126

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@145876 0039d316-1c4b-4281-b951-d872f2087c98
