[libcxx-commits] [libcxx] [libcxx] Add `locale` support for llvm `libc` (PR #97508)

via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jul 2 20:09:11 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Izaak Schroeder (izaakschroeder)

<details>
<summary>Changes</summary>

`libcxx` companion to https://github.com/llvm/llvm-project/pull/97494 and https://github.com/llvm/llvm-project/issues/97191

---
Full diff: https://github.com/llvm/llvm-project/pull/97508.diff


3 Files Affected:

- (modified) libcxx/include/__config (+1-1) 
- (modified) libcxx/include/locale (+1-1) 
- (modified) libcxx/src/locale.cpp (+1-1) 


``````````diff
diff --git a/libcxx/include/__config b/libcxx/include/__config
index dfb14fd6a380c..f3dbb8079a1e8 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -914,7 +914,7 @@ typedef __char32_t char32_t;
 #  endif
 
 #  if defined(__BIONIC__) || defined(__NuttX__) || defined(__Fuchsia__) || defined(__wasi__) ||                        \
-      defined(_LIBCPP_HAS_MUSL_LIBC) || defined(__OpenBSD__)
+      defined(_LIBCPP_HAS_MUSL_LIBC) || defined(__OpenBSD__) || defined(__LLVM_LIBC__)
 #    define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
 #  endif
 
diff --git a/libcxx/include/locale b/libcxx/include/locale
index 19e81e110b69c..46318683b3cef 100644
--- a/libcxx/include/locale
+++ b/libcxx/include/locale
@@ -217,7 +217,7 @@ template <class charT> class messages_byname;
 
 #if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
 // Most unix variants have catopen.  These are the specific ones that don't.
-#  if !defined(__BIONIC__) && !defined(_NEWLIB_VERSION) && !defined(__EMSCRIPTEN__)
+#  if !defined(__BIONIC__) && !defined(_NEWLIB_VERSION) && !defined(__EMSCRIPTEN__) && !defined(__LLVM_LIBC__)
 #    define _LIBCPP_HAS_CATOPEN 1
 #    include <nl_types.h>
 #  endif
diff --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp
index 4efdc63c09661..d114640ab7104 100644
--- a/libcxx/src/locale.cpp
+++ b/libcxx/src/locale.cpp
@@ -34,7 +34,7 @@
 #  define _CTYPE_DISABLE_MACROS
 #endif
 
-#if !defined(_LIBCPP_MSVCRT) && !defined(__MINGW32__) && !defined(__BIONIC__) && !defined(__NuttX__)
+#if !defined(_LIBCPP_MSVCRT) && !defined(__MINGW32__) && !defined(__BIONIC__) && !defined(__NuttX__)  && !defined(__LLVM_LIBC__)
 #  include <langinfo.h>
 #endif
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/97508


More information about the libcxx-commits mailing list