48#ifndef LIBOPENCM3_CM3_ASSERT_H
49#define LIBOPENCM3_CM3_ASSERT_H
53#define CM3_LIKELY(expr) (__builtin_expect(!!(expr), 1))
56# define cm3_assert(expr) (void)0
57# define cm3_assert_not_reached() do { } while (1)
59# ifdef CM3_ASSERT_VERBOSE
60# define cm3_assert(expr) do { \
61 if (CM3_LIKELY(expr)) { \
64 cm3_assert_failed_verbose( \
69# define cm3_assert_not_reached() \
70 cm3_assert_failed_verbose( \
86# define cm3_assert(expr) do { \
87 if (CM3_LIKELY(expr)) { \
90 cm3_assert_failed(); \
102# define cm3_assert_not_reached() cm3_assert_failed()
132 const char *assert_expr) __attribute__((__noreturn__));
void cm3_assert_failed_verbose(const char *file, int line, const char *func, const char *assert_expr)
Called on a failed assertion with verbose messages enabled.
void cm3_assert_failed(void)
Called on a failed assertion.