From 20f322d78c4300c6c286bb5489409f4581f2cc8a Mon Sep 17 00:00:00 2001 From: tildearrow Date: Wed, 2 Apr 2025 23:33:45 -0500 Subject: [PATCH] handle a situation in where MSVC uses C++17 always screwing something up --- src/log.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/log.cpp b/src/log.cpp index 696e5d24b..8e01358e1 100644 --- a/src/log.cpp +++ b/src/log.cpp @@ -99,7 +99,19 @@ int writeLog(int level, const char* msg, fmt::printf_args args) { int pos=(logPosition.fetch_add(1))&TA_LOG_MASK; #if FMT_VERSION >= 100100 +#ifdef _MSVC_LANG +#if _MSVC_LANG >= 201703L + logEntries[pos].text.assign(fmt::vsprintf(std::basic_string_view(msg),args)); +#else logEntries[pos].text.assign(fmt::vsprintf(fmt::basic_string_view(msg),args)); +#endif +#else +#if __cplusplus >= 201703L + logEntries[pos].text.assign(fmt::vsprintf(std::basic_string_view(msg),args)); +#else + logEntries[pos].text.assign(fmt::vsprintf(fmt::basic_string_view(msg),args)); +#endif +#endif #else logEntries[pos].text.assign(fmt::vsprintf(msg,args)); #endif