[libcxx-commits] [libcxx] [libcxx] Do not include `langinfo.h` when using the LLVM C library (PR #106634)

Joseph Huber via libcxx-commits libcxx-commits at lists.llvm.org
Fri Aug 30 06:47:34 PDT 2024


https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/106634

>From 1f06dd1185898fd0d23d839ab6f5fc436f0b4f04 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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp
index 4efdc63c096611..0f87c7099fe37e 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 __has_include("<langinfo.h>")
 #  include <langinfo.h>
 #endif
 



More information about the libcxx-commits mailing list