fmt10.patch 1.3 KB

12345678910111213141516171819202122232425
  1. diff --git a/include/spdlog/common.h b/include/spdlog/common.h
  2. index f97fd48c..e40e7591 100644
  3. --- a/include/spdlog/common.h
  4. +++ b/include/spdlog/common.h
  5. @@ -160,12 +160,19 @@ using format_string_t = fmt::format_string<Args...>;
  6. template<class T>
  7. using remove_cvref_t = typename std::remove_cv<typename std::remove_reference<T>::type>::type;
  8. +template <typename Char>
  9. +#if FMT_VERSION >= 90101
  10. +using fmt_runtime_string = fmt::runtime_format_string<Char>;
  11. +#else
  12. +using fmt_runtime_string = fmt::basic_runtime<Char>;
  13. +#endif
  14. +
  15. // clang doesn't like SFINAE disabled constructor in std::is_convertible<> so have to repeat the condition from basic_format_string here,
  16. // in addition, fmt::basic_runtime<Char> is only convertible to basic_format_string<Char> but not basic_string_view<Char>
  17. template<class T, class Char = char>
  18. struct is_convertible_to_basic_format_string
  19. : std::integral_constant<bool,
  20. - std::is_convertible<T, fmt::basic_string_view<Char>>::value || std::is_same<remove_cvref_t<T>, fmt::basic_runtime<Char>>::value>
  21. + std::is_convertible<T, fmt::basic_string_view<Char>>::value || std::is_same<remove_cvref_t<T>, fmt_runtime_string<Char>>::value>
  22. {};
  23. # if defined(SPDLOG_WCHAR_FILENAMES) || defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT)