Codechange: Use __VA_OPT__(,) instead of , ## (#12921)

`__VA_OPT__` is a C++20 standard, `##` is, apparently, a GNU extension.

MSVC needs /Zc:preprocessor adding for whatever reason.
This commit is contained in:
Peter Nelson
2024-09-12 07:06:15 +01:00
committed by GitHub
parent 7f5a3eaf83
commit ad5da0c924
5 changed files with 11 additions and 8 deletions

View File

@@ -14,7 +14,7 @@
[[noreturn]] void UserErrorI(const std::string &str);
[[noreturn]] void FatalErrorI(const std::string &str);
#define UserError(format_string, ...) UserErrorI(fmt::format(FMT_STRING(format_string), ## __VA_ARGS__))
#define FatalError(format_string, ...) FatalErrorI(fmt::format(FMT_STRING(format_string), ## __VA_ARGS__))
#define UserError(format_string, ...) UserErrorI(fmt::format(FMT_STRING(format_string) __VA_OPT__(,) __VA_ARGS__))
#define FatalError(format_string, ...) FatalErrorI(fmt::format(FMT_STRING(format_string) __VA_OPT__(,) __VA_ARGS__))
#endif /* ERROR_FUNC_H */