mirror of
https://github.com/tailix/libkernaux.git
synced 2026-08-15 11:00:07 -04:00
Add runtime assertions feature
This commit is contained in:
parent
089a16b02f
commit
690cfd32e3
10 changed files with 108 additions and 2 deletions
19
include/kernaux/assert.h
Normal file
19
include/kernaux/assert.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef KERNAUX_INCLUDED_ASSERT
|
||||
#define KERNAUX_INCLUDED_ASSERT 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define kernaux_assert(cond) \
|
||||
{ if (!(cond)) kernaux_assert_do(__FILE__, __LINE__, #cond); }
|
||||
|
||||
void kernaux_assert_do(const char *file, int line, const char *str);
|
||||
|
||||
extern void (*kernaux_assert_cb)(const char *file, int line, const char *str);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue