summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2023-06-15 19:37:31 -0700
committer3gg <3gg@shellblade.net>2023-06-15 19:37:31 -0700
commitc752222a285432bdd46e7b0096eb1fad6bd4eba0 (patch)
tree5a58566214051a432d91d99b40459d462a402262
parent35558f3c8a835103fb0b8f07b1c6efdb9bd087e8 (diff)
Remove use of non-standard __VA_OPT__
-rw-r--r--gfx/include/gfx/error.h18
1 files changed, 8 insertions, 10 deletions
diff --git a/gfx/include/gfx/error.h b/gfx/include/gfx/error.h
index dcb6932..062dba1 100644
--- a/gfx/include/gfx/error.h
+++ b/gfx/include/gfx/error.h
@@ -9,16 +9,14 @@ const char* gfx_get_error(void);
9extern xlstring gfx_error; 9extern xlstring gfx_error;
10 10
11/// Set the last error. 11/// Set the last error.
12#define gfx_set_error(FORMAT, ...) \ 12#define gfx_set_error(...) \
13 gfx_error.length = snprintf( \ 13 gfx_error.length = snprintf(gfx_error.str, xlstring_size, __VA_ARGS__)
14 gfx_error.str, xlstring_size, FORMAT __VA_OPT__(, ) __VA_ARGS__)
15 14
16/// Prepend an error to the last error. 15/// Prepend an error to the last error.
17#define gfx_prepend_error(FORMAT, ...) \ 16#define gfx_prepend_error(...) \
18 { \ 17 { \
19 xlstring head; \ 18 xlstring head; \
20 head.length = \ 19 head.length = snprintf(head.str, xlstring_size, __VA_ARGS__); \
21 snprintf(head.str, xlstring_size, FORMAT __VA_OPT__(, ) __VA_ARGS__); \ 20 xlstring_append(&head, xlstring_make(": ")); \
22 xlstring_append(&head, xlstring_make(": ")); \ 21 gfx_error = xlstring_concat(head, gfx_error); \
23 gfx_error = xlstring_concat(head, gfx_error); \
24 } 22 }