From fac8f396ccc2d7133058848bd2531ee0fb525130 Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Thu, 30 Jan 2014 15:25:20 +0400 Subject: [PATCH] deps: backport 883637bd from latest v8 Original commit message: VS2013 contains a number of improvements, most notably the addition of all C99 math functions. I'm a little bit concerned about the change I had to make in cpu-profiler.cc, but I spent quite a bit of time looking at it and was unable to figure out any rational explanation for the warning. It's possible it's spurious. Since it seems like a useful warning in general though, I chose not to disable globally at the gyp level. I do think someone with expertise here should probably try to determine if this is a legitimate warning. BUG=288948 R=dslomov@chromium.org Review URL: https://codereview.chromium.org/23449035 NOTE: Path applied without `cpu-profiler.cc` changes because in our version it was looking totally different. --- deps/v8/src/platform.h | 3 +++ deps/v8/src/preparser.cc | 4 ++-- deps/v8/src/win32-math.cc | 2 +- deps/v8/src/win32-math.h | 4 ++++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/deps/v8/src/platform.h b/deps/v8/src/platform.h index de896acad5..63a6e44550 100644 --- a/deps/v8/src/platform.h +++ b/deps/v8/src/platform.h @@ -71,6 +71,8 @@ int signbit(double x); int strncasecmp(const char* s1, const char* s2, int n); +// Visual C++ 2013 and higher implement this function. +#if (_MSC_VER < 1800) inline int lrint(double flt) { int intgr; #if defined(V8_TARGET_ARCH_IA32) @@ -88,6 +90,7 @@ inline int lrint(double flt) { return intgr; } +#endif // _MSC_VER < 1800 #endif // _MSC_VER diff --git a/deps/v8/src/preparser.cc b/deps/v8/src/preparser.cc index 21da4f80d4..5ea5ffa65b 100644 --- a/deps/v8/src/preparser.cc +++ b/deps/v8/src/preparser.cc @@ -44,8 +44,8 @@ namespace v8 { -#ifdef _MSC_VER -// Usually defined in math.h, but not in MSVC. +#if defined(_MSC_VER) && (_MSC_VER < 1800) +// Usually defined in math.h, but not in MSVC until VS2013+. // Abstracted to work int isfinite(double value); #endif diff --git a/deps/v8/src/win32-math.cc b/deps/v8/src/win32-math.cc index 3410872bb5..c119710176 100644 --- a/deps/v8/src/win32-math.cc +++ b/deps/v8/src/win32-math.cc @@ -29,7 +29,7 @@ // refer to The Open Group Base Specification for specification of the correct // semantics for these functions. // (http://www.opengroup.org/onlinepubs/000095399/) -#ifdef _MSC_VER +#if defined(_MSC_VER) && (_MSC_VER < 1800) #undef V8_WIN32_LEAN_AND_MEAN #define V8_WIN32_HEADERS_FULL diff --git a/deps/v8/src/win32-math.h b/deps/v8/src/win32-math.h index 68759990b4..7e7c1c73ba 100644 --- a/deps/v8/src/win32-math.h +++ b/deps/v8/src/win32-math.h @@ -37,6 +37,8 @@ #error Wrong environment, expected MSVC. #endif // _MSC_VER +// MSVC 2013+ provides implementations of all standard math functions. +#if (_MSC_VER < 1800) enum { FP_NAN, FP_INFINITE, @@ -58,4 +60,6 @@ int isgreater(double x, double y); int fpclassify(double x); int signbit(double x); +#endif // _MSC_VER < 1800 + #endif // V8_WIN32_MATH_H_