From 48b7e3dafb27ece02cd6addc8bd1041c79d59c2c Mon Sep 17 00:00:00 2001 From: Mattes D Date: Tue, 7 Jun 2022 00:43:02 +0200 Subject: [PATCH] Added a FMT_STRING wrapper for system_error() call. This enables the use of FMT_ENFORCE_COMPILE_STRING on MSVC 2019. --- include/fmt/format-inl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index 19f64c3f..f44df01c 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -80,7 +80,8 @@ FMT_FUNC void report_error(format_func func, int error_code, inline void fwrite_fully(const void* ptr, size_t size, size_t count, FILE* stream) { size_t written = std::fwrite(ptr, size, count, stream); - if (written < count) FMT_THROW(system_error(errno, "cannot write to file")); + if (written < count) + FMT_THROW(system_error(errno, FMT_STRING("cannot write to file"))); } #ifndef FMT_STATIC_THOUSANDS_SEPARATOR