diff options
Diffstat (limited to 'builtin/assert.h')
-rw-r--r-- | builtin/assert.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/builtin/assert.h b/builtin/assert.h index e58a450fa8..f51ea7b57a 100644 --- a/builtin/assert.h +++ b/builtin/assert.h @@ -27,7 +27,9 @@ extern noreturn void panic_assert_fail(const char *fname, int linenum); if (!(cond)) \ panic_assert_fail(__FILE__, __LINE__); \ } while (0) -#else + +#else /* !CONFIG_DEBUG_ASSERT_BRIEF */ + extern noreturn void panic_assert_fail(const char *msg, const char *func, const char *fname, int linenum); #define ASSERT(cond) \ @@ -36,18 +38,21 @@ extern noreturn void panic_assert_fail(const char *msg, const char *func, panic_assert_fail(#cond, __func__, __FILE__, \ __LINE__); \ } while (0) -#endif -#else +#endif /* CONFIG_DEBUG_ASSERT_BRIEF */ + +#else /* !CONFIG_DEBUG_ASSERT_REBOOTS */ + #define ASSERT(cond) \ do { \ if (!(cond)) \ __asm("bkpt"); \ __builtin_unreachable(); \ } while (0) -#endif -#else +#endif /* CONFIG_DEBUG_ASSERT_REBOOTS */ + +#else /* !CONFIG_DEBUG_ASSERT */ #define ASSERT(cond) -#endif +#endif /* CONFIG_DEBUG_ASSERT */ /* This collides with cstdlib, so exclude it where cstdlib is supported. */ #ifndef assert |