From ca1641e319fd421aa3dfe22bad871daa62d6906d Mon Sep 17 00:00:00 2001 From: Flavio Ceolin Date: Wed, 21 Nov 2018 16:10:18 -0800 Subject: [PATCH] misc: assert: Expand to nothing when disabled Make ASSERT macro expand to nothing when it is disabled during the build. Signed-off-by: Flavio Ceolin --- include/misc/__assert.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/include/misc/__assert.h b/include/misc/__assert.h index 3b7e67221a2..cb6cd8218bf 100644 --- a/include/misc/__assert.h +++ b/include/misc/__assert.h @@ -114,15 +114,11 @@ extern void posix_exit(int exit_code); #warning "__ASSERT() statements are ENABLED" #endif #else -#define __ASSERT(test, fmt, ...) \ - do {/* nothing */ \ - } while (false) +#define __ASSERT(test, fmt, ...) { } #define __ASSERT_EVAL(expr1, expr2, test, fmt, ...) expr1 #endif #else -#define __ASSERT(test, fmt, ...) \ - do {/* nothing */ \ - } while (false) +#define __ASSERT(test, fmt, ...) { } #define __ASSERT_EVAL(expr1, expr2, test, fmt, ...) expr1 #endif