forked from nuttx/nuttx-update
assert: add compile_assert macro
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
This commit is contained in:
parent
e88e3cd527
commit
64176214a0
1 changed files with 2 additions and 0 deletions
|
@ -152,6 +152,8 @@
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#define COMPILE_TIME_ASSERT(x) static_assert(x, "compile time assert failed")
|
||||
|
||||
/* Force a compilation error if condition is true, but also produce a
|
||||
* result (of value 0 and type int), so the expression can be used
|
||||
* e.g. in a structure initializer (or where-ever else comma expressions
|
||||
|
|
Loading…
Reference in a new issue