|
|
@ -116,6 +116,17 @@ using wstring_view_t = fmt::basic_string_view<wchar_t>;
|
|
|
|
using memory_buf_t = fmt::basic_memory_buffer<char, 250>;
|
|
|
|
using memory_buf_t = fmt::basic_memory_buffer<char, 250>;
|
|
|
|
using wmemory_buf_t = fmt::basic_memory_buffer<wchar_t, 250>;
|
|
|
|
using wmemory_buf_t = fmt::basic_memory_buffer<wchar_t, 250>;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<class T>
|
|
|
|
|
|
|
|
using remove_cvref_t = typename std::remove_cv<typename std::remove_reference<T>::type>::type;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// clang doesn't like SFINAE disabled constructor in std::is_convertible<> so have to repeat the condition from basic_format_string here,
|
|
|
|
|
|
|
|
// in addition, fmt::basic_runtime<Char> is only convertible to basic_format_string<Char> but not basic_string_view<Char>
|
|
|
|
|
|
|
|
template<class T, class Char = char>
|
|
|
|
|
|
|
|
struct is_convertible_to_basic_format_string
|
|
|
|
|
|
|
|
: std::integral_constant<bool,
|
|
|
|
|
|
|
|
std::is_convertible<T, fmt::basic_string_view<Char>>::value || std::is_same<remove_cvref_t<T>, fmt::basic_runtime<Char>>::value>
|
|
|
|
|
|
|
|
{};
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT
|
|
|
|
#ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT
|
|
|
|
# ifndef _WIN32
|
|
|
|
# ifndef _WIN32
|
|
|
|
# error SPDLOG_WCHAR_TO_UTF8_SUPPORT only supported on windows
|
|
|
|
# error SPDLOG_WCHAR_TO_UTF8_SUPPORT only supported on windows
|
|
|
@ -123,9 +134,9 @@ using wmemory_buf_t = fmt::basic_memory_buffer<wchar_t, 250>;
|
|
|
|
template<typename T>
|
|
|
|
template<typename T>
|
|
|
|
struct is_convertible_to_wstring_view : std::is_convertible<T, wstring_view_t>
|
|
|
|
struct is_convertible_to_wstring_view : std::is_convertible<T, wstring_view_t>
|
|
|
|
{};
|
|
|
|
{};
|
|
|
|
|
|
|
|
|
|
|
|
template<class T>
|
|
|
|
template<class T>
|
|
|
|
struct is_convertible_to_wformat_string : std::is_convertible<T, fmt::wformat_string<>>
|
|
|
|
using is_convertible_to_wformat_string = is_convertible_to_basic_format_string<T, wchar_t>;
|
|
|
|
{};
|
|
|
|
|
|
|
|
# endif // _WIN32
|
|
|
|
# endif // _WIN32
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
template<typename>
|
|
|
|
template<typename>
|
|
|
@ -137,8 +148,12 @@ struct is_convertible_to_wformat_string : std::false_type
|
|
|
|
#endif // SPDLOG_WCHAR_TO_UTF8_SUPPORT
|
|
|
|
#endif // SPDLOG_WCHAR_TO_UTF8_SUPPORT
|
|
|
|
|
|
|
|
|
|
|
|
template<class T>
|
|
|
|
template<class T>
|
|
|
|
struct is_convertible_to_basic_format_string
|
|
|
|
struct is_convertible_to_any_string_view
|
|
|
|
: std::integral_constant<bool, std::is_convertible<const T &, fmt::format_string<>>::value || is_convertible_to_wformat_string<T>::value>
|
|
|
|
: std::integral_constant<bool, std::is_convertible<T, string_view_t>::value || is_convertible_to_wstring_view<T>::value>
|
|
|
|
|
|
|
|
{};
|
|
|
|
|
|
|
|
template<class T>
|
|
|
|
|
|
|
|
struct is_convertible_to_any_format_string
|
|
|
|
|
|
|
|
: std::integral_constant<bool, is_convertible_to_basic_format_string<T, char>::value || is_convertible_to_wformat_string<T>::value>
|
|
|
|
{};
|
|
|
|
{};
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(SPDLOG_NO_ATOMIC_LEVELS)
|
|
|
|
#if defined(SPDLOG_NO_ATOMIC_LEVELS)
|
|
|
|