From: bmeurer@chromium.org Date: Tue, 27 Aug 2013 14:16:34 +0000 (+0000) Subject: Fix definition of V8_*_C() macros. X-Git-Tag: upstream/4.7.83~12798 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5857d951dd7343183b3ac2acfcb32959a7a3a274;p=platform%2Fupstream%2Fv8.git 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 --- diff --git a/include/v8config.h b/include/v8config.h index e72560f..2bf3b9d 100644 --- a/include/v8config.h +++ b/include/v8config.h @@ -93,6 +93,8 @@ // V8_CC_GNU - GNU C++ // V8_CC_INTEL - Intel C++ // 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++ // // C++11 feature detection @@ -166,7 +168,9 @@ # define V8_CC_GNU 1 // Intel C++ also masquerades as GCC 3.2.0 # 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)) diff --git a/src/globals.h b/src/globals.h index 6bb73cd..d0a57a4 100644 --- a/src/globals.h +++ b/src/globals.h @@ -171,27 +171,32 @@ typedef byte* Address; // Define our own macros for writing 64-bit constants. This is less fragile // than defining __STDC_CONSTANT_MACROS before including , and it // works on compilers that don't have it (like MSVC). -#if V8_HOST_ARCH_64_BIT -#if defined(_MSC_VER) -#define V8_UINT64_C(x) (x ## UI64) -#define V8_INT64_C(x) (x ## I64) -#define V8_INTPTR_C(x) (x ## I64) -#define V8_PTR_PREFIX "ll" -#elif defined(__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" +#if V8_CC_MSVC +# define V8_UINT64_C(x) (x ## UI64) +# define V8_INT64_C(x) (x ## I64) +# if V8_HOST_ARCH_64_BIT +# define V8_INTPTR_C(x) (x ## I64) +# define V8_PTR_PREFIX "ll" +# else +# define V8_INTPTR_C(x) (x) +# define V8_PTR_PREFIX "" +# endif // V8_HOST_ARCH_64_BIT +#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 -#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" +# define V8_UINT64_C(x) (x ## ULL) +# define V8_INT64_C(x) (x ## LL) +# define V8_INTPTR_C(x) (x) +# define V8_PTR_PREFIX "" #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. // Usage: instead of writing 0x1234567890123456