mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 03:45:50 +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:
+3
-1
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user