Support LLVM_STATIC_ASSERT() in clang pre-C++11 mode
authorAlp Toker <alp@nuanti.com>
Thu, 2 Jan 2014 04:07:41 +0000 (04:07 +0000)
committerAlp Toker <alp@nuanti.com>
Thu, 2 Jan 2014 04:07:41 +0000 (04:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198292 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/Compiler.h

index fb6ae5dee37449942d810217ea6ea4144d7464d6..6e840898c45d9aea9482b8adb99f60c5d48a1cf2 100644 (file)
 # define __has_feature(x) 0
 #endif
 
+#ifndef __has_extension
+# define __has_extension(x) 0
+#endif
+
 #ifndef __has_attribute
 # define __has_attribute(x) 0
 #endif
 # 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