Commit 9db8f821 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

Generalize V8_INFINITY and make it constexpr

Since we don't support gcc 2.96-4.0 any more, we can generalize the
V8_INFINITY macro to always use std::numeric_limits<double>::infinity().
This also makes value constexpr on all systems.

R=tebbi@chromium.org

Change-Id: Ifa97dd2ee6d2c1e179c45f60a82d1ea8481e0590
Reviewed-on: https://chromium-review.googlesource.com/725733Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48694}
parent 27a75926
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include <limits>
#include <ostream> #include <ostream>
#include "src/base/build_config.h" #include "src/base/build_config.h"
...@@ -41,21 +42,7 @@ ...@@ -41,21 +42,7 @@
#endif // V8_OS_WIN #endif // V8_OS_WIN
// Unfortunately, the INFINITY macro cannot be used with the '-pedantic' #define V8_INFINITY std::numeric_limits<double>::infinity()
// warning flag and certain versions of GCC due to a bug:
// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11931
// For now, we use the more involved template-based version from <limits>, but
// only when compiling with GCC versions affected by the bug (2.96.x - 4.0.x)
#if V8_CC_GNU && V8_GNUC_PREREQ(2, 96, 0) && !V8_GNUC_PREREQ(4, 1, 0)
# include <limits> // NOLINT
# define V8_INFINITY std::numeric_limits<double>::infinity()
#elif V8_LIBC_MSVCRT
# define V8_INFINITY HUGE_VAL
#elif V8_OS_AIX
#define V8_INFINITY (__builtin_inff())
#else
# define V8_INFINITY INFINITY
#endif
namespace v8 { namespace v8 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment