2021-12-14 20:37:11 +00:00
|
|
|
#ifndef KERNAUX_INCLUDED_ASSERT
|
2021-12-20 06:17:53 +00:00
|
|
|
#define KERNAUX_INCLUDED_ASSERT
|
2021-12-14 20:37:11 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2022-06-13 16:28:00 +00:00
|
|
|
#ifdef KERNAUX_DEBUG
|
2022-06-02 10:25:52 +00:00
|
|
|
#define KERNAUX_PANIC(msg) (kernaux_assert_do(__FILE__, __LINE__, msg))
|
|
|
|
#define KERNAUX_ASSERT(cond) ((cond) ? (void)0 : KERNAUX_PANIC(#cond))
|
2022-06-13 16:28:00 +00:00
|
|
|
#else
|
|
|
|
#define KERNAUX_PANIC(msg) ((void)0)
|
|
|
|
#define KERNAUX_ASSERT(cond) ((void)0)
|
|
|
|
#endif
|
2022-01-20 17:18:18 +00:00
|
|
|
|
2022-01-24 17:17:23 +00:00
|
|
|
void kernaux_assert_do(const char *file, int line, const char *msg);
|
2021-12-14 20:37:11 +00:00
|
|
|
|
2022-01-24 17:17:23 +00:00
|
|
|
extern void (*kernaux_assert_cb)(const char *file, int line, const char *msg);
|
2021-12-14 20:37:11 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|