1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-14 20:10:18 +03:00

Unified BUILD_BUG_ON and STATIC_ASSERT into STATIC_ASSERT.

This commit is contained in:
mikeller 2018-08-19 01:41:26 +12:00
parent 54dd79ac69
commit 70ac9423c7
10 changed files with 36 additions and 33 deletions

View file

@ -59,7 +59,9 @@
#endif
#define STATIC_ASSERT(condition, name) \
typedef char assert_failed_ ## name [(condition) ? 1 : -1 ] __attribute__((unused))
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))