diff options
author | Alp Toker <alp@nuanti.com> | 2014-01-02 04:07:41 +0000 |
---|---|---|
committer | Alp Toker <alp@nuanti.com> | 2014-01-02 04:07:41 +0000 |
commit | e7d30fb809cf05ebc3e8e1025d0774f731986763 (patch) | |
tree | a24d4cb38c5083b19eec463fe2790937e7caa76f /include/llvm/Support | |
parent | e61c70a08523ae2bc27fc1090357f535480ae244 (diff) | |
download | llvm-e7d30fb809cf05ebc3e8e1025d0774f731986763.tar.gz llvm-e7d30fb809cf05ebc3e8e1025d0774f731986763.tar.bz2 llvm-e7d30fb809cf05ebc3e8e1025d0774f731986763.tar.xz |
Support LLVM_STATIC_ASSERT() in clang pre-C++11 mode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198292 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support')
-rw-r--r-- | include/llvm/Support/Compiler.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/Support/Compiler.h b/include/llvm/Support/Compiler.h index fb6ae5dee3..6e840898c4 100644 --- a/include/llvm/Support/Compiler.h +++ b/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 |