[libcxx-commits] [libcxx] [libc++] In `<format>`, use availability macro if including `<locale>` (PR #99274)

Konstantin Varlamov via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jul 16 23:41:29 PDT 2024


https://github.com/var-const updated https://github.com/llvm/llvm-project/pull/99274

>From df8a44caec401ad4a274d85696c232c85d84d612 Mon Sep 17 00:00:00 2001
From: Konstantin Varlamov <varconst at apple.com>
Date: Tue, 16 Jul 2024 23:31:58 -0700
Subject: [PATCH 1/2] [libc++] In `<format>`, use availability macro if
 including `<locale>`

This is a follow-up to https://github.com/llvm/llvm-project/pull/85478,
similar to https://github.com/llvm/llvm-project/pull/95686.
---
 libcxx/include/format | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libcxx/include/format b/libcxx/include/format
index 07c2ba083199e..526174762797f 100644
--- a/libcxx/include/format
+++ b/libcxx/include/format
@@ -224,7 +224,9 @@ namespace std {
 #endif
 
 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#  if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
 #  include <locale>
+#  endif
 #  include <queue>
 #  include <stack>
 #endif

>From 74b8d6ee2b5b97c2167d7bf2727aaf2c3a1847e7 Mon Sep 17 00:00:00 2001
From: Konstantin Varlamov <varconst at apple.com>
Date: Tue, 16 Jul 2024 23:40:09 -0700
Subject: [PATCH 2/2] Fix formatting

---
 libcxx/include/format | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libcxx/include/format b/libcxx/include/format
index 526174762797f..e9b77e2aa6de2 100644
--- a/libcxx/include/format
+++ b/libcxx/include/format
@@ -225,7 +225,7 @@ namespace std {
 
 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
 #  if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
-#  include <locale>
+#    include <locale>
 #  endif
 #  include <queue>
 #  include <stack>



More information about the libcxx-commits mailing list