mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-26 10:31:34 +08:00
Added SPDLOG_FMT_RUNTIME macro for compatibilty with fmt prior 8
This commit is contained in:
parent
d38f89cae8
commit
fe1a4f5fb6
@ -37,9 +37,12 @@
|
|||||||
|
|
||||||
// backward compatibility with fmt versions older than 8
|
// backward compatibility with fmt versions older than 8
|
||||||
#if FMT_VERSION >= 80000
|
#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)
|
# if defined(SPDLOG_WCHAR_FILENAMES) || defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT)
|
||||||
# include <spdlog/fmt/xchar.h>
|
# include <spdlog/fmt/xchar.h>
|
||||||
# endif
|
# endif
|
||||||
|
#else
|
||||||
|
# define SPDLOG_FMT_RUNTIME(format_string) format_string
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// visual studio upto 2013 does not support noexcept nor constexpr
|
// visual studio upto 2013 does not support noexcept nor constexpr
|
||||||
|
@ -269,7 +269,6 @@ protected:
|
|||||||
details::backtracer tracer_;
|
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 FormatString, typename... Args, typename Char = fmt::char_t<FormatString>,
|
template<typename FormatString, typename... Args, typename Char = fmt::char_t<FormatString>,
|
||||||
typename std::enable_if<!std::is_same<Char, wchar_t>::value, Char>::type * = nullptr>
|
typename std::enable_if<!std::is_same<Char, wchar_t>::value, Char>::type * = nullptr>
|
||||||
void log_(source_loc loc, level::level_enum lvl, const FormatString &fmt, Args &&...args)
|
void log_(source_loc loc, level::level_enum lvl, const FormatString &fmt, Args &&...args)
|
||||||
|
@ -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
|
#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);
|
return fmt::format(fmt_filename, now_tm);
|
||||||
#else
|
#else
|
||||||
return fmt::format(fmt::runtime(fmt_filename), now_tm);
|
return fmt::format(SPDLOG_FMT_RUNTIME(fmt_filename), now_tm);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user