Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(474)

Unified Diff: include/v8config.h

Issue 152823003: A64: Synchronize with r16489. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/v8-profiler.h ('k') | src/a64/code-stubs-a64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8config.h
diff --git a/include/v8config.h b/include/v8config.h
index e72560f5ae2040ad4127ee9580b0bdbf96576198..0993a9f3e4fd9b7e13e8ca8eda8f83bb987a5bcd 100644
--- a/include/v8config.h
+++ b/include/v8config.h
@@ -28,6 +28,52 @@
#ifndef V8CONFIG_H_
#define V8CONFIG_H_
+// Platform headers for feature detection below.
+#if defined(__ANDROID__)
+# include <sys/cdefs.h>
+#elif defined(__APPLE__)
+# include <TargetConditionals.h>
+#elif defined(__linux__)
+# include <features.h>
+#endif
+
+
+// This macro allows to test for the version of the GNU C library (or
+// a compatible C library that masquerades as glibc). It evaluates to
+// 0 if libc is not GNU libc or compatible.
+// Use like:
+// #if V8_GLIBC_PREREQ(2, 3)
+// ...
+// #endif
+#if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
+# define V8_GLIBC_PREREQ(major, minor) \
+ ((__GLIBC__ * 100 + __GLIBC_MINOR__) >= ((major) * 100 + (minor)))
+#else
+# define V8_GLIBC_PREREQ(major, minor) 0
+#endif
+
+
+// This macro allows to test for the version of the GNU C++ compiler.
+// Note that this also applies to compilers that masquerade as GCC,
+// for example clang and the Intel C++ compiler for Linux.
+// Use like:
+// #if V8_GNUC_PREREQ(4, 3, 1)
+// ...
+// #endif
+#if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
+# define V8_GNUC_PREREQ(major, minor, patchlevel) \
+ ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= \
+ ((major) * 10000 + (minor) * 100 + (patchlevel)))
+#elif defined(__GNUC__) && defined(__GNUC_MINOR__)
+# define V8_GNUC_PREREQ(major, minor, patchlevel) \
+ ((__GNUC__ * 10000 + __GNUC_MINOR__) >= \
+ ((major) * 10000 + (minor) * 100 + (patchlevel)))
+#else
+# define V8_GNUC_PREREQ(major, minor, patchlevel) 0
+#endif
+
+
+
// -----------------------------------------------------------------------------
// Operating system detection
//
@@ -87,12 +133,40 @@
// -----------------------------------------------------------------------------
+// C library detection
+//
+// V8_LIBC_BIONIC - Bionic libc
+// V8_LIBC_BSD - BSD libc derivate
+// V8_LIBC_GLIBC - GNU C library
+// V8_LIBC_UCLIBC - uClibc
+//
+// Note that testing for libc must be done using #if not #ifdef. For example,
+// to test for the GNU C library, use:
+// #if V8_LIBC_GLIBC
+// ...
+// #endif
+
+#if defined(__BIONIC__)
+# define V8_LIBC_BIONIC 1
+# define V8_LIBC_BSD 1
+#elif defined(__UCLIBC__)
+# define V8_LIBC_UCLIBC 1
+#elif defined(__GLIBC__) || defined(__GNU_LIBRARY__)
+# define V8_LIBC_GLIBC 1
+#else
+# define V8_LIBC_BSD V8_OS_BSD
+#endif
+
+
+// -----------------------------------------------------------------------------
// Compiler detection
//
// V8_CC_CLANG - Clang
// 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
@@ -132,9 +206,6 @@
#if defined(__clang__)
-// Don't treat clang as GCC.
-# define V8_GNUC_PREREQ(major, minor, patchlevel) 0
-
# define V8_CC_CLANG 1
// Clang defines __alignof__ as alias for __alignof
@@ -159,14 +230,12 @@
#elif defined(__GNUC__)
-# define V8_GNUC_PREREQ(major, minor, patchlevel) \
- ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= \
- ((major) * 10000 + (minor) * 100 + (patchlevel)))
-
# 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))
@@ -203,8 +272,6 @@
#elif defined(_MSC_VER)
-# define V8_GNUC_PREREQ(major, minor, patchlevel) 0
-
# define V8_CC_MSVC 1
# define V8_HAS___ALIGNOF 1
« no previous file with comments | « include/v8-profiler.h ('k') | src/a64/code-stubs-a64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698