Fixed wchar support under msvc

This commit is contained in:
gabime
2021-06-26 19:43:37 +03:00
parent cdad84aa46
commit d75fd2c7f9
3 changed files with 28 additions and 0 deletions

View File

@@ -50,7 +50,11 @@ struct daily_filename_format_calculator
{
// generate fmt datetime format string, e.g. {:%Y-%m-%d}.
filename_t fmt_filename = fmt::format(SPDLOG_FILENAME_T("{{:{}}}"), filename);
#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);
#endif
}
};