[libcxx-commits] [libcxx] 1112b7b - [libcxx][AIX] Explicitly include localedef.h in locale.cpp

David Tenty via libcxx-commits libcxx-commits at lists.llvm.org
Tue Oct 12 09:00:09 PDT 2021


Author: David Tenty
Date: 2021-10-12T12:00:03-04:00
New Revision: 1112b7bad851c78af2159d39c7bff670a9c77da1

URL: https://github.com/llvm/llvm-project/commit/1112b7bad851c78af2159d39c7bff670a9c77da1
DIFF: https://github.com/llvm/llvm-project/commit/1112b7bad851c78af2159d39c7bff670a9c77da1.diff

LOG: [libcxx][AIX] Explicitly include localedef.h in locale.cpp

This header was transitively included to provide the definition of
__lc_ctype_ptr that we use on AIX, but that is fragile as it depends on
the settings of compatibility macros, so we explicitly include it here
to avoid that scenario.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D111239

Added: 
    

Modified: 
    libcxx/src/locale.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp
index d069b42aed9e7..44c24d0493a97 100644
--- a/libcxx/src/locale.cpp
+++ b/libcxx/src/locale.cpp
@@ -28,6 +28,10 @@
 #   include "cwctype"
 #endif
 
+#if defined(_AIX)
+#   include <sys/localedef.h> // for __lc_ctype_ptr
+#endif
+
 #if defined(_LIBCPP_MSVCRT)
 #   define _CTYPE_DISABLE_MACROS
 #endif


        


More information about the libcxx-commits mailing list