From ebea5736a2605864009ee21eb65c90cc2e4f5892 Mon Sep 17 00:00:00 2001 From: Gao Mingfei Date: Sun, 25 Feb 2024 23:09:33 +0800 Subject: [PATCH] Fix chrono locale format bug for RHEL gcc (#3859) --- include/fmt/chrono.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/fmt/chrono.h b/include/fmt/chrono.h index ac31baaaf2e1..cff7d68b9db7 100644 --- a/include/fmt/chrono.h +++ b/include/fmt/chrono.h @@ -398,8 +398,9 @@ auto write_encoded_tm_str(OutputIt out, string_view in, const std::locale& loc) if (detail::is_utf8() && loc != get_classic_locale()) { // char16_t and char32_t codecvts are broken in MSVC (linkage errors) and // gcc-4. -#if FMT_MSC_VERSION != 0 || \ - (defined(__GLIBCXX__) && !defined(_GLIBCXX_USE_DUAL_ABI)) +#if FMT_MSC_VERSION != 0 || \ + (defined(__GLIBCXX__) && \ + (!defined(_GLIBCXX_USE_DUAL_ABI) || _GLIBCXX_USE_DUAL_ABI == 0)) // The _GLIBCXX_USE_DUAL_ABI macro is always defined in libstdc++ from gcc-5 // and newer. using code_unit = wchar_t;