]> git.bts.cx Git - benzene.git/blob - src/bz/debug/assert.h
Sprites
[benzene.git] / src / bz / debug / assert.h
1 #ifndef BZ_DEBUG_ASSERT_H
2 #define BZ_DEBUG_ASSERT_H
3
4 #include <bz/debug/log.h>
5
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9
10 #define bzAssertMessage(test, fmt, ...) {if ((test) != true) { bzError(fmt, ##__VA_ARGS__); bzAssertExit(); } }
11 #define bzAssert(test) bzAssertMessage(test, "failed assertion \""#test"\"")
12
13 extern void bzAssertExit(void); // TODO: Consider moving this to generic failure handling
14
15 #ifdef __cplusplus
16 }
17 #endif
18
19 #endif