diff options
Diffstat (limited to 'src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h')
-rw-r--r-- | src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h index 352a74b..74b0172 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h @@ -240,8 +240,15 @@ while (0) /* COMPILE_ASSERT */ #ifndef COMPILE_ASSERT +#if COMPILER_SUPPORTS(C_STATIC_ASSERT) +/* Unlike static_assert below, this also works in plain C code. */ +#define COMPILE_ASSERT(exp, name) _Static_assert((exp), #name) +#elif COMPILER_SUPPORTS(CXX_STATIC_ASSERT) +#define COMPILE_ASSERT(exp, name) static_assert((exp), #name) +#else #define COMPILE_ASSERT(exp, name) typedef int dummy##name [(exp) ? 1 : -1] #endif +#endif /* FATAL */ |