projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cda8083
)
Introduce LLVM_STATIC_ASSERT macro, which expands to C/C++'s static_assert on compile...
author
Argyrios Kyrtzidis
<akyrtzi@gmail.com>
Fri, 22 Mar 2013 03:10:51 +0000
(
03:10
+0000)
committer
Argyrios Kyrtzidis
<akyrtzi@gmail.com>
Fri, 22 Mar 2013 03:10:51 +0000
(
03:10
+0000)
llvm-svn: 177699
llvm/include/llvm/Support/Compiler.h
patch
|
blob
|
history
diff --git
a/llvm/include/llvm/Support/Compiler.h
b/llvm/include/llvm/Support/Compiler.h
index
25f42a9
..
13d057b
100644
(file)
--- a/
llvm/include/llvm/Support/Compiler.h
+++ b/
llvm/include/llvm/Support/Compiler.h
@@
-351,4
+351,14
@@
#define LLVM_EXPLICIT
#endif
+/// \macro LLVM_STATIC_ASSERT
+/// \brief Expands to C/C++'s static_assert on compilers which support it.
+#if __has_feature(cxx_static_assert)
+# 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)
+#else
+# define LLVM_STATIC_ASSERT(expr, msg)
+#endif
+
#endif