Commit 215da5ec authored by bmeurer@chromium.org's avatar bmeurer@chromium.org

v8config.h: introduce V8_LIBC_MSVCRT

Use this for detecting MSVCRT library features instead of
V8_CC_MSVC.

One use case for this is when compiling with Clang together with the
MSVC library. In that case, V8_CC_MSVC will be false, but V8_LIBC_MSVCRT
will be true.

BUG=82385
LOG=n
R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/145593003

Patch from Hans Wennborg <hans@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18888 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 90706159
...@@ -139,6 +139,7 @@ ...@@ -139,6 +139,7 @@
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// C library detection // C library detection
// //
// V8_LIBC_MSVCRT - MSVC libc
// V8_LIBC_BIONIC - Bionic libc // V8_LIBC_BIONIC - Bionic libc
// V8_LIBC_BSD - BSD libc derivate // V8_LIBC_BSD - BSD libc derivate
// V8_LIBC_GLIBC - GNU C library // V8_LIBC_GLIBC - GNU C library
...@@ -150,7 +151,9 @@ ...@@ -150,7 +151,9 @@
// ... // ...
// #endif // #endif
#if defined(__BIONIC__) #if defined (_MSC_VER)
# define V8_LIBC_MSVCRT 1
#elif defined(__BIONIC__)
# define V8_LIBC_BIONIC 1 # define V8_LIBC_BIONIC 1
# define V8_LIBC_BSD 1 # define V8_LIBC_BSD 1
#elif defined(__UCLIBC__) #elif defined(__UCLIBC__)
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include "cpu.h" #include "cpu.h"
#if V8_CC_MSVC #if V8_LIBC_MSVCRT
#include <intrin.h> // __cpuid() #include <intrin.h> // __cpuid()
#endif #endif
#if V8_OS_POSIX #if V8_OS_POSIX
...@@ -54,8 +54,8 @@ namespace internal { ...@@ -54,8 +54,8 @@ namespace internal {
#if V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64 #if V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64
// Define __cpuid() for non-MSVC compilers. // Define __cpuid() for non-MSVC libraries.
#if !V8_CC_MSVC #if !V8_LIBC_MSVCRT
static V8_INLINE void __cpuid(int cpu_info[4], int info_type) { static V8_INLINE void __cpuid(int cpu_info[4], int info_type) {
#if defined(__i386__) && defined(__pic__) #if defined(__i386__) && defined(__pic__)
...@@ -77,7 +77,7 @@ static V8_INLINE void __cpuid(int cpu_info[4], int info_type) { ...@@ -77,7 +77,7 @@ static V8_INLINE void __cpuid(int cpu_info[4], int info_type) {
#endif // defined(__i386__) && defined(__pic__) #endif // defined(__i386__) && defined(__pic__)
} }
#endif // !V8_CC_MSVC #endif // !V8_LIBC_MSVCRT
#elif V8_HOST_ARCH_ARM || V8_HOST_ARCH_MIPS #elif V8_HOST_ARCH_ARM || V8_HOST_ARCH_MIPS
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#if V8_CC_GNU && V8_GNUC_PREREQ(2, 96, 0) && !V8_GNUC_PREREQ(4, 1, 0) #if V8_CC_GNU && V8_GNUC_PREREQ(2, 96, 0) && !V8_GNUC_PREREQ(4, 1, 0)
# include <limits> // NOLINT # include <limits> // NOLINT
# define V8_INFINITY std::numeric_limits<double>::infinity() # define V8_INFINITY std::numeric_limits<double>::infinity()
#elif V8_CC_MSVC #elif V8_LIBC_MSVCRT
# define V8_INFINITY HUGE_VAL # define V8_INFINITY HUGE_VAL
#else #else
# define V8_INFINITY INFINITY # define V8_INFINITY INFINITY
......
...@@ -64,7 +64,7 @@ int signbit(double x); ...@@ -64,7 +64,7 @@ int signbit(double x);
#endif #endif
// Microsoft Visual C++ specific stuff. // Microsoft Visual C++ specific stuff.
#if V8_CC_MSVC #if V8_LIBC_MSVCRT
#include "win32-headers.h" #include "win32-headers.h"
#include "win32-math.h" #include "win32-math.h"
...@@ -91,7 +91,7 @@ inline int lrint(double flt) { ...@@ -91,7 +91,7 @@ inline int lrint(double flt) {
} }
#endif // _MSC_VER < 1800 #endif // _MSC_VER < 1800
#endif // V8_CC_MSVC #endif // V8_LIBC_MSVCRT
namespace v8 { namespace v8 {
namespace internal { namespace internal {
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
#include "unicode.h" #include "unicode.h"
#include "utils.h" #include "utils.h"
#if V8_CC_MSVC && (_MSC_VER < 1800) #if V8_LIBC_MSVCRT && (_MSC_VER < 1800)
namespace std { namespace std {
// Usually defined in math.h, but not in MSVC until VS2013+. // Usually defined in math.h, but not in MSVC until VS2013+.
......
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