37# define _BLI_ASSERT_PRINT_POS(a) _BLI_assert_print_pos(__FILE__, __LINE__, __func__, #a)
38# elif defined(_MSC_VER)
39# define _BLI_ASSERT_PRINT_POS(a) _BLI_assert_print_pos(__FILE__, __LINE__, __func__, #a)
41# define _BLI_ASSERT_PRINT_POS(a) _BLI_assert_print_pos(__FILE__, __LINE__, "<?>", #a)
44# ifdef WITH_ASSERT_ABORT
45# define _BLI_ASSERT_ABORT _BLI_assert_abort
47# define _BLI_ASSERT_ABORT() (void)0
50# define BLI_assert(a) \
51 (void)((!(a)) ? ((_BLI_assert_print_backtrace(), \
52 _BLI_ASSERT_PRINT_POS(a), \
53 _BLI_ASSERT_ABORT(), \
57# define BLI_assert_msg(a, msg) \
58 (void)((!(a)) ? ((_BLI_assert_print_backtrace(), \
59 _BLI_ASSERT_PRINT_POS(a), \
60 _BLI_assert_print_extra(msg), \
61 _BLI_ASSERT_ABORT(), \
65# define BLI_assert(a) ((void)0)
66# define BLI_assert_msg(a, msg) ((void)0)
69#if defined(__cplusplus)
71# define BLI_STATIC_ASSERT(a, msg) static_assert(a, msg);
72#elif defined(_MSC_VER)
74# if !defined(__clang__)
75# define BLI_STATIC_ASSERT(a, msg) static_assert(a, msg);
77# define BLI_STATIC_ASSERT(a, msg) _STATIC_ASSERT(a);
79#elif defined(__COVERITY__)
81# define BLI_STATIC_ASSERT(a, msg)
82#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
84# define BLI_STATIC_ASSERT(a, msg) _Static_assert(a, msg);
87# define BLI_STATIC_ASSERT(a, msg)
90#define BLI_STATIC_ASSERT_ALIGN(st, align) \
91 BLI_STATIC_ASSERT((sizeof(st) % (align) == 0), "Structure must be strictly aligned")
97#define BLI_assert_unreachable() \
99 _BLI_assert_unreachable_print(__FILE__, __LINE__, __func__); \
100 BLI_assert_msg(0, "This line of code is marked to be unreachable."); \
void _BLI_assert_print_backtrace(void)
void _BLI_assert_print_extra(const char *str)
void _BLI_assert_abort(void)
void _BLI_assert_print_pos(const char *file, int line, const char *function, const char *id)
void _BLI_assert_unreachable_print(const char *file, int line, const char *function)