Define STATIC_ASSERT(cond, msg) to be _Static_assert(cond, msg) everywhere but on Windows where it stays to be INSIST(cond)

This commit is contained in:
Ondřej Surý 2018-11-13 21:43:11 +01:00 committed by Mark Andrews
parent 82b23ecc5e
commit 5e44a1008f

View file

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