Support LLVM_STATIC_ASSERT() in clang pre-C++11 mode

llvm-svn: 198292
This commit is contained in:
Alp Toker 2014-01-02 04:07:41 +00:00
parent 83b7e24b76
commit 1d5e0d308a
1 changed files with 6 additions and 0 deletions

View File

@ -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