summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 }