Revision: 15736
Author:   [email protected]
Date:     Thu Jul 18 00:43:41 2013
Log:      Use C++11 static_assert() if available.

[email protected]

Review URL: https://codereview.chromium.org/19684009
http://code.google.com/p/v8/source/detail?r=15736

Modified:
 /branches/bleeding_edge/src/checks.h

=======================================
--- /branches/bleeding_edge/src/checks.h        Wed Sep  5 09:06:53 2012
+++ /branches/bleeding_edge/src/checks.h        Thu Jul 18 00:43:41 2013
@@ -230,6 +230,13 @@
 #define CHECK_LE(a, b) CHECK((a) <= (b))


+// Use C++11 static_assert if possible, which gives error
+// messages that are easier to understand on first sight.
+#if __cplusplus >= 201103L || \
+    (defined(__has_feature) && __has_feature(cxx_static_assert)) || \
+    (defined(__has_extension) && __has_extension(cxx_static_assert))
+#define STATIC_CHECK(test) static_assert(test, #test)
+#else
 // This is inspired by the static assertion facility in boost.  This
 // is pretty magical.  If it causes you trouble on a platform you may
 // find a fix in the boost code.
@@ -249,6 +256,7 @@
typedef \ StaticAssertionHelper<sizeof(StaticAssertion<static_cast<bool>((test))>)> \
     SEMI_STATIC_JOIN(__StaticAssertTypedef__, __LINE__)
+#endif


 extern bool FLAG_enable_slow_asserts;

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to