diff --git a/include/assert.h b/include/assert.h index 89d550a6000..45d6e4d3230 100644 --- a/include/assert.h +++ b/include/assert.h @@ -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)