summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFedor Indutny <fedor.indutny@gmail.com>2014-01-30 15:25:20 +0400
committerFedor Indutny <fedor.indutny@gmail.com>2014-02-01 00:45:55 +0400
commitfac8f396ccc2d7133058848bd2531ee0fb525130 (patch)
tree6fd602cae63aa1d017364fdc2995dddec74ef394
parente796e11087f1f6d04422d52ac333cc0fc0862750 (diff)
downloadnode-fac8f396ccc2d7133058848bd2531ee0fb525130.tar.gz
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.
-rw-r--r--deps/v8/src/platform.h3
-rw-r--r--deps/v8/src/preparser.cc4
-rw-r--r--deps/v8/src/win32-math.cc2
-rw-r--r--deps/v8/src/win32-math.h4
4 files changed, 10 insertions, 3 deletions
diff --git a/deps/v8/src/platform.h b/deps/v8/src/platform.h
index de896acad..63a6e4455 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 21da4f80d..5ea5ffa65 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 3410872bb..c11971017 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 68759990b..7e7c1c73b 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_