summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-01-02 04:07:41 +0000
committerAlp Toker <alp@nuanti.com>2014-01-02 04:07:41 +0000
commit1d5e0d308a29a77e131e6616465c2a84a5af453d (patch)
tree62119cbb704187aa06abfb6f4c7e1bb16bef12d5 /llvm
parent83b7e24b76b0da85e886f8dd6aff4e4421f6ad53 (diff)
downloadbcm5719-llvm-1d5e0d308a29a77e131e6616465c2a84a5af453d.tar.gz
bcm5719-llvm-1d5e0d308a29a77e131e6616465c2a84a5af453d.zip
Support LLVM_STATIC_ASSERT() in clang pre-C++11 mode
llvm-svn: 198292
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Support/Compiler.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/include/llvm/Support/Compiler.h b/llvm/include/llvm/Support/Compiler.h
index fb6ae5dee37..6e840898c45 100644
--- a/llvm/include/llvm/Support/Compiler.h
+++ b/llvm/include/llvm/Support/Compiler.h
@@ -21,6 +21,10 @@
# define __has_feature(x) 0
#endif
+#ifndef __has_extension
+# define __has_extension(x) 0
+#endif
+
#ifndef __has_attribute
# define __has_attribute(x) 0
#endif
@@ -394,6 +398,8 @@
# define LLVM_STATIC_ASSERT(expr, msg) static_assert(expr, msg)
#elif __has_feature(c_static_assert)
# define LLVM_STATIC_ASSERT(expr, msg) _Static_assert(expr, msg)
+#elif __has_extension(c_static_assert)
+# define LLVM_STATIC_ASSERT(expr, msg) LLVM_EXTENSION _Static_assert(expr, msg)
#else
# define LLVM_STATIC_ASSERT(expr, msg)
#endif
OpenPOWER on IntegriCloud