/** * Runtime assertions * * Enabled when DI_DEBUG macro is defined (debug builds) * * The application is responsible for supplying the _di_assert function * * Or compiling src/assert.c with LIBDI_HAS_STDIO_PRINTF */ #ifndef DI_ASSERT_H_ #define DI_ASSERT_H_ #ifdef __cplusplus extern "C" { #endif #if defined(DI_DEBUG) || defined(__DOXYGEN__) void _di_assert(int expression, const char *expr, const char *file, const int line, const char *func); #define di_assert(expression) _di_assert(expression, #expression, __FILE__, __LINE__, __func__); #else #define di_assert(expression)((void)0) #endif #ifdef __cplusplus } #endif #endif /* DI_ASSERT_H_ */