aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cassert/include/cassert.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/cassert/include/cassert.h b/cassert/include/cassert.h
index 3349b55..e1c38d6 100644
--- a/cassert/include/cassert.h
+++ b/cassert/include/cassert.h
@@ -6,19 +6,19 @@
6// Allow the client to define their own LOGE() macro. 6// Allow the client to define their own LOGE() macro.
7#ifndef LOGE 7#ifndef LOGE
8#include <stdio.h> 8#include <stdio.h>
9#define LOGE(...) \ 9#define LOGE(format, ...) \
10 { \ 10 { \
11 fprintf(stderr, "[ASSERT] %s:%d: ", __FILE__, __LINE__); \ 11 fprintf( \
12 fprintf(stderr, __VA_ARGS__); \ 12 stderr, "[ASSERT] %s:%d " format "\n", __FILE__, \
13 fprintf(stderr, "\n"); \ 13 __LINE__ __VA_OPT__(, ) __VA_ARGS__); \
14 } 14 }
15#endif // LOGE 15#endif // LOGE
16 16
17#define TRAP() raise(SIGTRAP) 17#define TRAP() raise(SIGTRAP)
18 18
19/// Unconditional hard assert. 19/// Unconditional hard assert.
20#define FAIL(message) \ 20#define FAIL(format, ...) \
21 LOGE(message); \ 21 LOGE(format, __VA_ARGS__); \
22 TRAP(); 22 TRAP();
23 23
24/// Conditional hard assert. 24/// Conditional hard assert.