1
0
Fork 0
mirror of https://github.com/tailix/libkernaux.git synced 2024-10-30 11:54:01 -04:00
libkernaux/include/kernaux/assert.h

24 lines
545 B
C

#ifndef KERNAUX_INCLUDED_ASSERT
#define KERNAUX_INCLUDED_ASSERT
#ifdef __cplusplus
extern "C" {
#endif
#ifdef KERNAUX_DEBUG
#define KERNAUX_PANIC(msg) (kernaux_assert_do(__FILE__, __LINE__, msg))
#define KERNAUX_ASSERT(cond) ((cond) ? (void)0 : KERNAUX_PANIC(#cond))
#else
#define KERNAUX_PANIC(msg) ((void)0)
#define KERNAUX_ASSERT(cond) ((void)0)
#endif
void kernaux_assert_do(const char *file, int line, const char *msg);
extern void (*kernaux_assert_cb)(const char *file, int line, const char *msg);
#ifdef __cplusplus
}
#endif
#endif