Revert "assert: change the do-while of assert to a conditional expression"

This reverts commit 23aba6c2a1.
This commit is contained in:
Masayuki Ishikawa 2024-02-22 10:32:37 +09:00 committed by Xiang Xiao
parent e6ca27ac2f
commit 1a11479831

View File

@ -77,10 +77,20 @@
__ASSERT_LINE__, msg, regs)
#define __ASSERT__(f, file, line, _f) \
(predict_false(!(f))) ? __assert(file, line, _f) : ((void)0)
do \
{ \
if (predict_false(!(f))) \
__assert(file, line, _f); \
} \
while (0)
#define __VERIFY__(f, file, line, _f) \
(predict_false((f) < 0)) ? __assert(file, line, _f) : ((void)0)
do \
{ \
if (predict_false((f) < 0)) \
__assert(file, line, _f); \
} \
while (0)
#ifdef CONFIG_DEBUG_ASSERTIONS_EXPRESSION
# define _ASSERT(f,file,line) __ASSERT__(f, file, line, #f)