diff --git a/include/spdlog/common.h b/include/spdlog/common.h index 3d939cc2..d6434893 100644 --- a/include/spdlog/common.h +++ b/include/spdlog/common.h @@ -37,9 +37,12 @@ // backward compatibility with fmt versions older than 8 #if FMT_VERSION >= 80000 +# define SPDLOG_FMT_RUNTIME(format_string) fmt::runtime(format_string) # if defined(SPDLOG_WCHAR_FILENAMES) || defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT) # include # endif +#else +# define SPDLOG_FMT_RUNTIME(format_string) format_string #endif // visual studio upto 2013 does not support noexcept nor constexpr diff --git a/include/spdlog/logger.h b/include/spdlog/logger.h index 2e5675b7..2e3af4bc 100644 --- a/include/spdlog/logger.h +++ b/include/spdlog/logger.h @@ -268,8 +268,7 @@ protected: err_handler custom_err_handler_{nullptr}; details::backtracer tracer_; - // common implementation for after templated public api has been resolved - + // common implementation for after templated public api has been resolved template, typename std::enable_if::value, Char>::type * = nullptr> void log_(source_loc loc, level::level_enum lvl, const FormatString &fmt, Args &&...args) diff --git a/include/spdlog/sinks/daily_file_sink.h b/include/spdlog/sinks/daily_file_sink.h index 4b9062d5..d6a09f6b 100644 --- a/include/spdlog/sinks/daily_file_sink.h +++ b/include/spdlog/sinks/daily_file_sink.h @@ -53,7 +53,7 @@ struct daily_filename_format_calculator #if defined(_MSC_VER) && defined(SPDLOG_WCHAR_FILENAMES) // for some reason msvc doesnt allow fmt::runtime(..) with wchar here return fmt::format(fmt_filename, now_tm); #else - return fmt::format(fmt::runtime(fmt_filename), now_tm); + return fmt::format(SPDLOG_FMT_RUNTIME(fmt_filename), now_tm); #endif } };