Commit 5e44a100 authored by Ondřej Surý's avatar Ondřej Surý Committed by Mark Andrews
Browse files

Define STATIC_ASSERT(cond, msg) to be _Static_assert(cond, msg) everywhere but...

Define STATIC_ASSERT(cond, msg) to be _Static_assert(cond, msg) everywhere but on Windows where it stays to be INSIST(cond)
parent 82b23ecc
......@@ -208,6 +208,18 @@
#define ISC_UNREACHABLE()
#endif
#if !defined(__has_feature)
#define __has_feature(x) 0
#endif
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR >= 6)
#define STATIC_ASSERT(cond, msg) _Static_assert(cond, msg)
#elif __has_feature(c_static_assert)
#define STATIC_ASSERT(cond, msg) _Static_assert(cond, msg)
#else
#define STATIC_ASSERT(cond, msg) INSIST(cond)
#endif
#ifdef UNIT_TESTING
extern void mock_assert(const int result, const char* const expression,
const char * const file, const int line);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment