1
0
Fork 0
forked from nuttx/nuttx-update

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:
chao an 2024-08-19 22:49:30 +08:00 committed by Xiang Xiao
parent 64176214a0
commit f12c88d287

View file

@ -152,7 +152,9 @@
# 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
* result (of value 0 and type int), so the expression can be used