aboutsummaryrefslogtreecommitdiff
path: root/cassert/include
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2024-08-28 09:14:46 -0700
committer3gg <3gg@shellblade.net>2024-08-28 09:14:46 -0700
commit05e2669fd81d33b2ac76b1369a706df90d046517 (patch)
treeb6716cad7cb10ff3f8dc039812eca5f32b99e61d /cassert/include
parentbec2d50c843ec4fd98bbbb212848ce4f24b96ebb (diff)
Fix LOGE macro.
Diffstat (limited to 'cassert/include')
-rw-r--r--cassert/include/cassert.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/cassert/include/cassert.h b/cassert/include/cassert.h
index acfcb0f..bb98f50 100644
--- a/cassert/include/cassert.h
+++ b/cassert/include/cassert.h
@@ -7,25 +7,25 @@
7#ifndef LOGE 7#ifndef LOGE
8#include <stdio.h> 8#include <stdio.h>
9// __VA_OPT__ is not available until C2X. 9// __VA_OPT__ is not available until C2X.
10#define LOGE(format, ...) \ 10/*#define LOGE(format, ...) \
11 { \ 11 { \
12 fprintf( \ 12 fprintf( \
13 stderr, "[ASSERT] %s:%d " format "\n", __FILE__, \ 13 stderr, "[ASSERT] %s:%d " format "\n", __FILE__, \
14 __LINE__ __VA_OPT__(, ) __VA_ARGS__); \ 14 __LINE__ __VA_OPT__(, ) __VA_ARGS__); \
15 } 15 }*/
16/*#define LOGE(...) \ 16#define LOGE(...) \
17 { \ 17 { \
18 fprintf(stderr, "[ASSERT] %s:%d ", __FILE__, __LINE__); \ 18 fprintf(stderr, "[ASSERT] %s:%d ", __FILE__, __LINE__); \
19 fprintf(stderr, __VA_ARGS__); \ 19 fprintf(stderr, __VA_ARGS__); \
20 fprintf(stderr, "\n"); \ 20 fprintf(stderr, "\n"); \
21 }*/ 21 }
22#endif // LOGE 22#endif // LOGE
23 23
24#define TRAP() raise(SIGTRAP) 24#define TRAP() raise(SIGTRAP)
25 25
26/// Unconditional hard assert. 26/// Unconditional hard assert.
27#define FAIL(format, ...) \ 27#define FAIL(...) \
28 LOGE(format, __VA_ARGS__); \ 28 LOGE(__VA_ARGS__); \
29 TRAP(); 29 TRAP();
30 30
31//// Conditional hard assert. 31//// Conditional hard assert.