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 <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2018-11-21 16:10:18 -08:00 committed by Anas Nashif
parent 6e1f6e5d5d
commit ca1641e319

View File

@ -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