mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 11:56:10 +08:00
assert: add compile_assert macro
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
This commit is contained in:
@@ -152,6 +152,8 @@
|
|||||||
# endif
|
# endif
|
||||||
#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
|
/* 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
|
* 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
|
* e.g. in a structure initializer (or where-ever else comma expressions
|
||||||
|
|||||||
Reference in New Issue
Block a user