mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 05:08:41 +08:00
assert: check COMPILE_TIME_ASSERT before define
check COMPILE_TIME_ASSERT before define Signed-off-by: chao an <anchao@lixiang.com>
This commit is contained in:
parent
64176214a0
commit
f12c88d287
1 changed files with 3 additions and 1 deletions
|
@ -152,7 +152,9 @@
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define COMPILE_TIME_ASSERT(x) static_assert(x, "compile time assert failed")
|
#ifndef COMPILE_TIME_ASSERT
|
||||||
|
# define COMPILE_TIME_ASSERT(x) static_assert(x, "compile time assert failed")
|
||||||
|
#endif
|
||||||
|
|
||||||
/* 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
|
||||||
|
|
Loading…
Reference in a new issue