mirror of
https://github.com/isc-projects/bind9.git
synced 2026-04-28 01:28:05 -04:00
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:
parent
82b23ecc5e
commit
5e44a1008f
1 changed files with 12 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue