[libcxx-commits] [PATCH] D90319: [SystemZ][z/OS] Enable POSIX_l functions for z/OS

Abhina Sree via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Nov 10 06:57:23 PST 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGe72e785d4707: [SystemZ][z/OS] Enable POSIX_l functions for z/OS (authored by muiez, committed by abhina.sreeskantharajan).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90319/new/

https://reviews.llvm.org/D90319

Files:
  libcxx/include/__config
  libcxx/include/__locale
  libcxx/include/support/ibm/xlocale.h


Index: libcxx/include/support/ibm/xlocale.h
===================================================================
--- libcxx/include/support/ibm/xlocale.h
+++ libcxx/include/support/ibm/xlocale.h
@@ -11,13 +11,13 @@
 #define _LIBCPP_SUPPORT_IBM_XLOCALE_H
 #include <support/ibm/locale_mgmt_aix.h>
 
-#if defined(_AIX)
 #include "cstdlib"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+#if defined(_AIX)
 #if !defined(_AIX71)
 // AIX 7.1 and higher has these definitions.  Definitions and stubs
 // are provied here as a temporary workaround on AIX 6.1.
@@ -207,14 +207,20 @@
 }
 #endif // !defined(_AIX71)
 
-// strftime_l() is defined by POSIX. However, AIX 7.1 does not have it
-// implemented yet.
+// strftime_l() is defined by POSIX. However, AIX 7.1 and z/OS do not have it
+// implemented yet. z/OS retrieves it from the POSIX fallbacks.
 static inline
 size_t strftime_l(char *__s, size_t __size, const char *__fmt,
                   const struct tm *__tm, locale_t locale) {
   return __xstrftime(locale, __s, __size, __fmt, __tm);
 }
 
+#elif defined(__MVS__)
+#include <wctype.h>
+// POSIX routines
+#include <support/xlocale/__posix_l_fallback.h>
+#endif // defined(__MVS__)
+
 // The following are not POSIX routines.  These are quick-and-dirty hacks
 // to make things pretend to work
 static inline
@@ -266,5 +272,4 @@
 #ifdef __cplusplus
 }
 #endif
-#endif // defined(_AIX)
 #endif // _LIBCPP_SUPPORT_IBM_XLOCALE_H
Index: libcxx/include/__locale
===================================================================
--- libcxx/include/__locale
+++ libcxx/include/__locale
@@ -22,7 +22,7 @@
 #if defined(_LIBCPP_MSVCRT_LIKE)
 # include <cstring>
 # include <support/win32/locale_win32.h>
-#elif defined(_AIX)
+#elif defined(_AIX) || defined(__MVS__)
 # include <support/ibm/xlocale.h>
 #elif defined(__ANDROID__)
 # include <support/android/locale_bionic.h>
Index: libcxx/include/__config
===================================================================
--- libcxx/include/__config
+++ libcxx/include/__config
@@ -1219,8 +1219,9 @@
 #  endif
 #endif
 
-#if defined(__BIONIC__) || defined(__CloudABI__) ||                            \
-    defined(__Fuchsia__) || defined(__wasi__) || defined(_LIBCPP_HAS_MUSL_LIBC)
+#if defined(__BIONIC__) || defined(__CloudABI__) || \
+    defined(__Fuchsia__) || defined(__wasi__) || defined(_LIBCPP_HAS_MUSL_LIBC) || \
+    defined(__MVS__)
 #define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
 #endif
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90319.304173.patch
Type: text/x-patch
Size: 2448 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20201110/a400419f/attachment-0001.bin>


More information about the libcxx-commits mailing list