From 8548c2d0373c8b0b8578623a58b2328245e2ad75 Mon Sep 17 00:00:00 2001 From: Quinn Date: Fri, 12 Sep 2025 17:34:04 +0200 Subject: [PATCH] fix: log macros were using GNU extensions without them needing them. We can optionally add `,` utilising the `__VA_OPT__` macro. However, this lead to the next problem, which is that an empty vardiac parameter is a C23 extension. This was solved by dropping the string parameter, making it be part of the vardiac parameters. --- src/error.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/error.h b/src/error.h index 92dd94b..75d9612 100644 --- a/src/error.h +++ b/src/error.h @@ -15,8 +15,8 @@ void error_war(uint ln, const char *restrict file, const char *restrict fmt, ... void error_err(uint ln, const char *restrict file, const char *restrict fmt, ...); void error_fat(uint ln, const char *restrict file, const char *restrict fmt, ...) NORET; -#define debug(s, ...) error_dbg(__LINE__, __FILE__, s, ##__VA_ARGS__) -#define info(s, ...) error_inf(__LINE__, __FILE__, s, ##__VA_ARGS__) -#define warn(s, ...) error_war(__LINE__, __FILE__, s, ##__VA_ARGS__) -#define error(s, ...) error_err(__LINE__, __FILE__, s, ##__VA_ARGS__) -#define fatal(s, ...) error_fat(__LINE__, __FILE__, s, ##__VA_ARGS__) +#define debug(...) error_dbg(__LINE__, __FILE__ __VA_OPT__(, ) __VA_ARGS__) +#define info(...) error_inf(__LINE__, __FILE__ __VA_OPT__(, ) __VA_ARGS__) +#define warn(...) error_war(__LINE__, __FILE__ __VA_OPT__(, ) __VA_ARGS__) +#define error(...) error_err(__LINE__, __FILE__ __VA_OPT__(, ) __VA_ARGS__) +#define fatal(...) error_fat(__LINE__, __FILE__ __VA_OPT__(, ) __VA_ARGS__)