diff options
author | 3gg <3gg@shellblade.net> | 2024-04-13 13:24:51 -0700 |
---|---|---|
committer | 3gg <3gg@shellblade.net> | 2024-04-13 13:24:51 -0700 |
commit | 111e2f413374b77b04be9ff991aa74c995e96ff0 (patch) | |
tree | b88eb6f87bca748874ae4b0d5f333ac52c086917 /cassert/include | |
parent | 6aea96466ee881fa16116de6380ca693c95165e2 (diff) |
Avoid __VA_OPT__; not available until C2X.
Diffstat (limited to 'cassert/include')
-rw-r--r-- | cassert/include/cassert.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/cassert/include/cassert.h b/cassert/include/cassert.h index ef6e033..8cd1391 100644 --- a/cassert/include/cassert.h +++ b/cassert/include/cassert.h | |||
@@ -6,11 +6,18 @@ | |||
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(format, ...) \ | 9 | // __VA_OPT__ is not available until C2X. |
10 | { \ | 10 | /*#define LOGE(format, ...) \ |
11 | fprintf( \ | 11 | // { \ |
12 | stderr, "[ASSERT] %s:%d " format "\n", __FILE__, \ | 12 | // fprintf( \ |
13 | __LINE__ __VA_OPT__(, ) __VA_ARGS__); \ | 13 | // stderr, "[ASSERT] %s:%d " format "\n", __FILE__, \ |
14 | // __LINE__ __VA_OPT__(, ) __VA_ARGS__); \ | ||
15 | // }*/ | ||
16 | #define LOGE(...) \ | ||
17 | { \ | ||
18 | fprintf(stderr, "[ASSERT] %s:%d ", __FILE__, __LINE__); \ | ||
19 | fprintf(stderr, __VA_ARGS__); \ | ||
20 | fprintf(stderr, "\n"); \ | ||
14 | } | 21 | } |
15 | #endif // LOGE | 22 | #endif // LOGE |
16 | 23 | ||