libkernaux/include/kernaux/assert.h

25 lines
545 B
C
Raw Normal View History

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
#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
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