44 # define DEBUG_ASSERT_VERBOSE
58 # define DEBUG_ASSERT_BREAKPOINT
61 # define _likely(x) __builtin_expect((uintptr_t)(x), 1)
65 # if defined(__GNUC__) || defined(DOXYGEN)
73 # define __NORETURN __attribute__((noreturn))
104 # define assert(ignore)((void)0)
105 #elif defined(DEBUG_ASSERT_VERBOSE)
143 # define assert(cond) (_likely(cond) ? (void)0 : _assert_failure(__FILE__, __LINE__))
145 # define assert(cond) (_likely(cond) ? (void)0 : _assert_panic())
148 #if !defined __cplusplus
149 # if __STDC_VERSION__ >= 201112L
153 # define static_assert(...) _Static_assert(__VA_ARGS__)
160 # define static_assert(cond, ...) \
161 { enum { static_assert_failed_on_div_by_0 = 1 / (!!(cond)) }; }
170 #ifndef DEBUG_ASSERT_NO_PANIC
171 # 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.