🛠 Fix assumptions of Unicode for Clang-on-Windows

💡 MSVC fixed this linker errors (at some point); should check for newer versions and just use the char32_t-based version properly.
This commit is contained in:
ThePhD 2023-12-12 14:47:15 -05:00
parent 43135ae2d0
commit b2d2d3920b
No known key found for this signature in database
GPG Key ID: 1509DB1C0F702BFA
2 changed files with 8 additions and 2 deletions

View File

@ -362,7 +362,7 @@ auto write_encoded_tm_str(OutputIt out, string_view in, const std::locale& loc)
if (detail::is_utf8() && loc != get_classic_locale()) { if (detail::is_utf8() && loc != get_classic_locale()) {
// char16_t and char32_t codecvts are broken in MSVC (linkage errors) and // char16_t and char32_t codecvts are broken in MSVC (linkage errors) and
// gcc-4. // gcc-4.
#if FMT_MSC_VERSION != 0 || \ #if FMT_MSC_VERSION < 1932 || \
(defined(__GLIBCXX__) && !defined(_GLIBCXX_USE_DUAL_ABI)) (defined(__GLIBCXX__) && !defined(_GLIBCXX_USE_DUAL_ABI))
// The _GLIBCXX_USE_DUAL_ABI macro is always defined in libstdc++ from gcc-5 // The _GLIBCXX_USE_DUAL_ABI macro is always defined in libstdc++ from gcc-5
// and newer. // and newer.

View File

@ -233,7 +233,13 @@
#endif #endif
#ifndef FMT_UNICODE #ifndef FMT_UNICODE
# define FMT_UNICODE !FMT_MSC_VERSION # if FMT_CLANG_VERSION
# define FMT_UNICODE 1
# elif defined(_MSVC_EXECUTION_CHARACTER_SET) && (_MSVC_EXECUTION_CHARACTER_SET == 65001)
# define FMT_UNICODE 1
# else
# define FMT_UNICODE !FMT_MSC_VERSION
# endif
#endif #endif
#ifndef FMT_CONSTEVAL #ifndef FMT_CONSTEVAL