[libcxx-commits] [libcxx] [libc] Do not include `langinfo.h` when using the LLVM C library (PR #106634)
Joseph Huber via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Aug 29 14:24:25 PDT 2024
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/106634
Summary:
The `langinfo.h` header is a POSIX extension, so ideally we would be
able to build the C++ library without it. Currently the LLVM C library
doesn't support / provide it. This allows us to build the C++ library
with locales enabled. We can either disable it here, or just provide
stubs that do nothing as in https://github.com/llvm/llvm-project/pull/106620.
>From f7871f587c1d9e9ca0787c95eb5078fd1753f4e1 Mon Sep 17 00:00:00 2001
From: Joseph Huber <huberjn at outlook.com>
Date: Thu, 29 Aug 2024 16:22:30 -0500
Subject: [PATCH] [libc] Do not include `langinfo.h` when using the LLVM C
library
Summary:
The `langinfo.h` header is a POSIX extension, so ideally we would be
able to build the C++ library without it. Currently the LLVM C library
doesn't support / provide it. This allows us to build the C++ library
with locales enabled. We can either disable it here, or just provide
stubs that do nothing as in https://github.com/llvm/llvm-project/pull/106620.
---
libcxx/src/locale.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp
index 4efdc63c096611..06c4f414ed9fa9 100644
--- a/libcxx/src/locale.cpp
+++ b/libcxx/src/locale.cpp
@@ -34,7 +34,8 @@
# 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
More information about the libcxx-commits
mailing list