diff --git a/include/spdlog/common.h b/include/spdlog/common.h index b702c485..0d170412 100644 --- a/include/spdlog/common.h +++ b/include/spdlog/common.h @@ -127,35 +127,33 @@ using err_handler = std::function; namespace fmt_lib = std; using string_view_t = std::string_view; -using wstring_view_t = std::wstring_view; using memory_buf_t = std::string; -using wmemory_buf_t = std::wstring; template using format_string_t = std::string_view; -template -using wformat_string_t = std::wstring_view; - template struct is_convertible_to_basic_format_string : std::integral_constant>::value> {}; + +# if defined(SPDLOG_WCHAR_FILENAMES) || defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT) +using wstring_view_t = std::wstring_view; +using memory_buf_t = std::wstring; + +template +using wformat_string_t = std::wstring_view; +# endif #else namespace fmt_lib = fmt; using string_view_t = fmt::basic_string_view; -using wstring_view_t = fmt::basic_string_view; using memory_buf_t = fmt::basic_memory_buffer; -using wmemory_buf_t = fmt::basic_memory_buffer; template using format_string_t = fmt::format_string; -template -using wformat_string_t = fmt::basic_format_string...>; - template using remove_cvref_t = typename std::remove_cv::type>::type; @@ -166,6 +164,14 @@ struct is_convertible_to_basic_format_string : std::integral_constant>::value || std::is_same, fmt::basic_runtime>::value> {}; + +# if defined(SPDLOG_WCHAR_FILENAMES) || defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT) +using wstring_view_t = fmt::basic_string_view; +using wmemory_buf_t = fmt::basic_memory_buffer;; + +template +using wformat_string_t = fmt::wformat_string; +# endif #endif #ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT