Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gabime/spdlog.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author刘耘呈 <40971483+YunchengLiu@users.noreply.github.com>2022-10-20 02:11:16 +0300
committerGitHub <noreply@github.com>2022-10-20 02:11:16 +0300
commit3c0e036cc9e12664e2b757fd17fdba42f6f19f90 (patch)
treed72d7bbca8efa2e293a0b3a84589bc3057a85c97
parentbced42485535b1a6dae0a0bad5c1203c3afad894 (diff)
Use 'SPDLOG_FMT_RUNTIME' to fix compilation error throwed MSVC and fmt 9.1.x (#2517)
* Use 'SPDLOG_FMT_RUNTIME' to fix compilation error throwed MSVC and fmt 9.1.x * Fix #2512
-rw-r--r--include/spdlog/sinks/daily_file_sink.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h
index b07b771d..f6f1bb1d 100644
--- a/include/spdlog/sinks/daily_file_sink.h
+++ b/include/spdlog/sinks/daily_file_sink.h
@@ -77,11 +77,14 @@ struct daily_filename_format_calculator
#else
// generate fmt datetime format string, e.g. {:%Y-%m-%d}.
filename_t fmt_filename = fmt::format(SPDLOG_FMT_STRING(SPDLOG_FILENAME_T("{{:{}}}")), filename);
-# if defined(_MSC_VER) && defined(SPDLOG_WCHAR_FILENAMES) // for some reason msvc doesn't allow fmt::runtime(..) with wchar here
+
+ // MSVC doesn't allow fmt::runtime(..) with wchar, with fmtlib versions < 9.1.x
+# if defined(_MSC_VER) && defined(SPDLOG_WCHAR_FILENAMES) && FMT_VERSION < 90101
return fmt::format(fmt_filename, now_tm);
# else
return fmt::format(SPDLOG_FMT_RUNTIME(fmt_filename), now_tm);
# endif
+
#endif
}