ciabatta/inc/assert.h

18 lines
661 B
C

#pragma once
#include "_macros.h"
extern void _assert_error(char *cond, char const *func, char const *file, char const *line);
#if defined(NDEBUG)
#define assert(ignore) ((void)0)
#else
#define _static_assert _Static_assert
#define assert(condition) \
do { \
if(!(condition)) { \
_assert_error(#condition, _func, __FILE__, _str(__LINE__)); \
} \
} while(0)
#endif