Switched to using '_Static_assert'.

This commit is contained in:
mikeller 2018-08-20 10:49:16 +12:00
parent 70ac9423c7
commit 37568a7078
1 changed files with 1 additions and 4 deletions

View File

@ -58,10 +58,7 @@
#define UNUSED(x) (void)(x) #define UNUSED(x) (void)(x)
#endif #endif
#define STATIC_ASSERT(condition, name) \ #define STATIC_ASSERT(condition, name) _Static_assert((condition), #name)
enum { assert_failed_ ## name = sizeof(char [(condition) ? 1 : -1 ]) }
// If it is decided to ditch the -Wpedantic build flag, this should be switched to:
// _Static_assert((condition), #name)
#define BIT(x) (1 << (x)) #define BIT(x) (1 << (x))