Commit 5857d951 authored by bmeurer@chromium.org's avatar bmeurer@chromium.org

Fix definition of V8_*_C() macros.

Make V8_INT64_C() and V8_UINT64_C() available in 32-bit mode as well,
so we can write readable constants (base 10) instead of having to
obfuscate them using V8_2PART_UINT64_C().

R=svenpanne@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16366 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent b2ca7e0b
...@@ -93,6 +93,8 @@ ...@@ -93,6 +93,8 @@
// V8_CC_GNU - GNU C++ // V8_CC_GNU - GNU C++
// V8_CC_INTEL - Intel C++ // V8_CC_INTEL - Intel C++
// V8_CC_MINGW - Minimalist GNU for Windows // V8_CC_MINGW - Minimalist GNU for Windows
// V8_CC_MINGW32 - Minimalist GNU for Windows (mingw32)
// V8_CC_MINGW64 - Minimalist GNU for Windows (mingw-w64)
// V8_CC_MSVC - Microsoft Visual C/C++ // V8_CC_MSVC - Microsoft Visual C/C++
// //
// C++11 feature detection // C++11 feature detection
...@@ -166,7 +168,9 @@ ...@@ -166,7 +168,9 @@
# define V8_CC_GNU 1 # define V8_CC_GNU 1
// Intel C++ also masquerades as GCC 3.2.0 // Intel C++ also masquerades as GCC 3.2.0
# define V8_CC_INTEL (defined(__INTEL_COMPILER)) # define V8_CC_INTEL (defined(__INTEL_COMPILER))
# define V8_CC_MINGW (defined(__MINGW32__)) # define V8_CC_MINGW32 (defined(__MINGW32__))
# define V8_CC_MINGW64 (defined(__MINGW64__))
# define V8_CC_MINGW (V8_CC_MINGW32 || V8_CC_MINGW64)
# define V8_HAS___ALIGNOF__ (V8_GNUC_PREREQ(4, 3, 0)) # define V8_HAS___ALIGNOF__ (V8_GNUC_PREREQ(4, 3, 0))
......
...@@ -171,27 +171,32 @@ typedef byte* Address; ...@@ -171,27 +171,32 @@ typedef byte* Address;
// Define our own macros for writing 64-bit constants. This is less fragile // Define our own macros for writing 64-bit constants. This is less fragile
// than defining __STDC_CONSTANT_MACROS before including <stdint.h>, and it // than defining __STDC_CONSTANT_MACROS before including <stdint.h>, and it
// works on compilers that don't have it (like MSVC). // works on compilers that don't have it (like MSVC).
#if V8_HOST_ARCH_64_BIT #if V8_CC_MSVC
#if defined(_MSC_VER) # define V8_UINT64_C(x) (x ## UI64)
#define V8_UINT64_C(x) (x ## UI64) # define V8_INT64_C(x) (x ## I64)
#define V8_INT64_C(x) (x ## I64) # if V8_HOST_ARCH_64_BIT
#define V8_INTPTR_C(x) (x ## I64) # define V8_INTPTR_C(x) (x ## I64)
#define V8_PTR_PREFIX "ll" # define V8_PTR_PREFIX "ll"
#elif defined(__MINGW64__) # else
#define V8_UINT64_C(x) (x ## ULL) # define V8_INTPTR_C(x) (x)
#define V8_INT64_C(x) (x ## LL) # define V8_PTR_PREFIX ""
#define V8_INTPTR_C(x) (x ## LL) # endif // V8_HOST_ARCH_64_BIT
#define V8_PTR_PREFIX "I64" #elif V8_CC_MINGW64
# define V8_UINT64_C(x) (x ## ULL)
# define V8_INT64_C(x) (x ## LL)
# define V8_INTPTR_C(x) (x ## LL)
# define V8_PTR_PREFIX "I64"
#elif V8_HOST_ARCH_64_BIT
# define V8_UINT64_C(x) (x ## UL)
# define V8_INT64_C(x) (x ## L)
# define V8_INTPTR_C(x) (x ## L)
# define V8_PTR_PREFIX "l"
#else #else
#define V8_UINT64_C(x) (x ## UL) # define V8_UINT64_C(x) (x ## ULL)
#define V8_INT64_C(x) (x ## L) # define V8_INT64_C(x) (x ## LL)
#define V8_INTPTR_C(x) (x ## L) # define V8_INTPTR_C(x) (x)
#define V8_PTR_PREFIX "l" # define V8_PTR_PREFIX ""
#endif #endif
#else // V8_HOST_ARCH_64_BIT
#define V8_INTPTR_C(x) (x)
#define V8_PTR_PREFIX ""
#endif // V8_HOST_ARCH_64_BIT
// The following macro works on both 32 and 64-bit platforms. // The following macro works on both 32 and 64-bit platforms.
// Usage: instead of writing 0x1234567890123456 // Usage: instead of writing 0x1234567890123456
......
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