[libcxx-commits] [libcxx] [libc++][z/OS] Need to define _LIBCPP_HAS_UNICODE to 0 for EBCDIC (PR #119244)

Zibi Sarbinowski via libcxx-commits libcxx-commits at lists.llvm.org
Mon Dec 9 10:47:08 PST 2024


https://github.com/zibi2 updated https://github.com/llvm/llvm-project/pull/119244

>From 32c66931d1bf7e17ad05625eb57ec03bad587f36 Mon Sep 17 00:00:00 2001
From: Zbigniew Sarbinowski <zibi at ca.ibm.com>
Date: Mon, 9 Dec 2024 18:49:37 +0000
Subject: [PATCH 1/2] Need to define _LIBCPP_HAS_UNICODE to 0 for EBCDIC

---
 libcxx/include/__config_site.in | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libcxx/include/__config_site.in b/libcxx/include/__config_site.in
index fc01aaf2d8746e..b575a5de8e0d0b 100644
--- a/libcxx/include/__config_site.in
+++ b/libcxx/include/__config_site.in
@@ -28,7 +28,11 @@
 #cmakedefine01 _LIBCPP_HAS_FILESYSTEM
 #cmakedefine01 _LIBCPP_HAS_RANDOM_DEVICE
 #cmakedefine01 _LIBCPP_HAS_LOCALIZATION
+#if defined(__MVS__) && !defined(__NATIVE_ASCII_F)
+#cmakedefine _LIBCPP_HAS_UNICODE 0
+#else
 #cmakedefine01 _LIBCPP_HAS_UNICODE
+#endif
 #cmakedefine01 _LIBCPP_HAS_WIDE_CHARACTERS
 #cmakedefine _LIBCPP_HAS_NO_STD_MODULES
 #cmakedefine01 _LIBCPP_HAS_TIME_ZONE_DATABASE

>From d3870490b5db77ac326fe675dbebad36f7abe7d8 Mon Sep 17 00:00:00 2001
From: Zbigniew Sarbinowski <zibi at ca.ibm.com>
Date: Mon, 9 Dec 2024 19:01:16 +0000
Subject: [PATCH 2/2] fixing build

---
 libcxx/include/locale | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libcxx/include/locale b/libcxx/include/locale
index aa6733427d2d08..d7cb32cb3182e4 100644
--- a/libcxx/include/locale
+++ b/libcxx/include/locale
@@ -722,7 +722,7 @@ __num_get_signed_integral(const char* __a, const char* __a_end, ios_base::iostat
     __libcpp_remove_reference_t<decltype(errno)> __save_errno = errno;
     errno                                                     = 0;
     char* __p2;
-    long long __ll = __locale::__strtoll(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
+    long long __ll = __locale::__libcpp_strtoll(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
     __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
     if (__current_errno == 0)
       errno = __save_errno;
@@ -754,7 +754,7 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end, ios_base::iost
     __libcpp_remove_reference_t<decltype(errno)> __save_errno = errno;
     errno                                                     = 0;
     char* __p2;
-    unsigned long long __ll = __locale::__strtoull(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
+    unsigned long long __ll = __locale::__libcpp_strtoull(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
     __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
     if (__current_errno == 0)
       errno = __save_errno;
@@ -779,17 +779,17 @@ _LIBCPP_HIDE_FROM_ABI _Tp __do_strtod(const char* __a, char** __p2);
 
 template <>
 inline _LIBCPP_HIDE_FROM_ABI float __do_strtod<float>(const char* __a, char** __p2) {
-  return __locale::__strtof(__a, __p2, _LIBCPP_GET_C_LOCALE);
+  return __locale::__libcpp_strtof(__a, __p2, _LIBCPP_GET_C_LOCALE);
 }
 
 template <>
 inline _LIBCPP_HIDE_FROM_ABI double __do_strtod<double>(const char* __a, char** __p2) {
-  return __locale::__strtod(__a, __p2, _LIBCPP_GET_C_LOCALE);
+  return __locale::__libcpp_strtod(__a, __p2, _LIBCPP_GET_C_LOCALE);
 }
 
 template <>
 inline _LIBCPP_HIDE_FROM_ABI long double __do_strtod<long double>(const char* __a, char** __p2) {
-  return __locale::__strtold(__a, __p2, _LIBCPP_GET_C_LOCALE);
+  return __locale::__libcpp_strtold(__a, __p2, _LIBCPP_GET_C_LOCALE);
 }
 
 template <class _Tp>



More information about the libcxx-commits mailing list