[libcxx-commits] [libcxx] 109bff1 - [libcxx] Do not include `langinfo.h` when using the LLVM C library (#106634)
via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Aug 31 05:07:45 PDT 2024
Author: Joseph Huber
Date: 2024-08-31T07:07:42-05:00
New Revision: 109bff1f1656e87933f7650f9a77dedeb0c8688c
URL: https://github.com/llvm/llvm-project/commit/109bff1f1656e87933f7650f9a77dedeb0c8688c
DIFF: https://github.com/llvm/llvm-project/commit/109bff1f1656e87933f7650f9a77dedeb0c8688c.diff
LOG: [libcxx] Do not include `langinfo.h` when using the LLVM C library (#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.
Added:
Modified:
libcxx/src/locale.cpp
Removed:
################################################################################
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