From 964f9a1e3de6c8efe8b43e57d0da86ea1bfc691d Mon Sep 17 00:00:00 2001 From: Gao Mingfei Date: Tue, 20 Feb 2024 11:59:32 +0800 Subject: [PATCH 1/2] Fix chrono locale format bug for RHEL gcc Fix #3858 Signed-off-by: Gao Mingfei --- include/fmt/chrono.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/fmt/chrono.h b/include/fmt/chrono.h index ac31baaaf2e1..67ab86ea4cb4 100644 --- a/include/fmt/chrono.h +++ b/include/fmt/chrono.h @@ -399,7 +399,8 @@ auto write_encoded_tm_str(OutputIt out, string_view in, const std::locale& loc) // 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)) + (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; From e9ea1b4499f9231305b4fa60c994d7b9970d5a3d Mon Sep 17 00:00:00 2001 From: Gao Mingfei Date: Tue, 20 Feb 2024 12:37:55 +0800 Subject: [PATCH 2/2] fix format --- include/fmt/chrono.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/fmt/chrono.h b/include/fmt/chrono.h index 67ab86ea4cb4..cff7d68b9db7 100644 --- a/include/fmt/chrono.h +++ b/include/fmt/chrono.h @@ -398,7 +398,7 @@ 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 || \ +#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