47 # define DEBUG_ASSERT_VERBOSE
61 # define DEBUG_ASSERT_BREAKPOINT
64 # define _likely(x) __builtin_expect((uintptr_t)(x), 1)
68 # if defined(__GNUC__) || defined(DOXYGEN)
76 # define __NORETURN __attribute__((noreturn))
107 # define assert(ignore)((void)0)
108 #elif defined(DEBUG_ASSERT_VERBOSE)
146 # define assert(cond) (_likely(cond) ? (void)0 : _assert_failure(__FILE__, __LINE__))
148 # define assert(cond) (_likely(cond) ? (void)0 : _assert_panic())
151 #if !defined __cplusplus
152 # if __STDC_VERSION__ >= 201112L
156 # define static_assert(...) _Static_assert(__VA_ARGS__)
163 # define static_assert(cond, ...) \
164 { enum { static_assert_failed_on_div_by_0 = 1 / (!!(cond)) }; }
173 #ifndef DEBUG_ASSERT_NO_PANIC
174 # define DEBUG_ASSERT_NO_PANIC (1)
__NORETURN void _assert_failure(const char *file, unsigned line)
Function to handle failed assertion.
__NORETURN void _assert_panic(void)
Internal function to trigger a panic with a failed assertion as identifying cause.
#define __NORETURN
Same as NORETURN.