Skip to content

Commit 0ca574a

Browse files
authored
fix build for master fmt (non-bundled) (#2694)
* fix build for master fmt (non-bundled) * update fmt_runtime_string macro * fix build of updated macro
1 parent 069a2e8 commit 0ca574a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

include/spdlog/common.h

+8-1
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,19 @@ using format_string_t = fmt::format_string<Args...>;
173173
template<class T>
174174
using remove_cvref_t = typename std::remove_cv<typename std::remove_reference<T>::type>::type;
175175

176+
template <typename Char>
177+
#if FMT_VERSION >= 90101
178+
using fmt_runtime_string = fmt::runtime_format_string<Char>;
179+
#else
180+
using fmt_runtime_string = fmt::basic_runtime<Char>;
181+
#endif
182+
176183
// clang doesn't like SFINAE disabled constructor in std::is_convertible<> so have to repeat the condition from basic_format_string here,
177184
// in addition, fmt::basic_runtime<Char> is only convertible to basic_format_string<Char> but not basic_string_view<Char>
178185
template<class T, class Char = char>
179186
struct is_convertible_to_basic_format_string
180187
: std::integral_constant<bool,
181-
std::is_convertible<T, fmt::basic_string_view<Char>>::value || std::is_same<remove_cvref_t<T>, fmt::basic_runtime<Char>>::value>
188+
std::is_convertible<T, fmt::basic_string_view<Char>>::value || std::is_same<remove_cvref_t<T>, fmt_runtime_string<Char>>::value>
182189
{};
183190

184191
# if defined(SPDLOG_WCHAR_FILENAMES) || defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT)

0 commit comments

Comments
 (0)