diff --git a/libcxx/include/__config b/libcxx/include/__config --- a/libcxx/include/__config +++ b/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 diff --git a/libcxx/include/__locale b/libcxx/include/__locale --- a/libcxx/include/__locale +++ b/libcxx/include/__locale @@ -21,7 +21,7 @@ #if defined(_LIBCPP_MSVCRT_LIKE) # include # include -#elif defined(_AIX) +#elif defined(_AIX) || defined(__MVS__) # include #elif defined(__ANDROID__) # include diff --git a/libcxx/include/support/ibm/xlocale.h b/libcxx/include/support/ibm/xlocale.h --- a/libcxx/include/support/ibm/xlocale.h +++ b/libcxx/include/support/ibm/xlocale.h @@ -11,13 +11,13 @@ #define _LIBCPP_SUPPORT_IBM_XLOCALE_H #include -#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 +// POSIX routines +#include +#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