aboutsummaryrefslogtreecommitdiff
path: root/repos/clang/llvm/0013-libc-musl-locale-workarounds.patch
diff options
context:
space:
mode:
Diffstat (limited to 'repos/clang/llvm/0013-libc-musl-locale-workarounds.patch')
-rwxr-xr-xrepos/clang/llvm/0013-libc-musl-locale-workarounds.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/repos/clang/llvm/0013-libc-musl-locale-workarounds.patch b/repos/clang/llvm/0013-libc-musl-locale-workarounds.patch
new file mode 100755
index 00000000..a5c3769e
--- /dev/null
+++ b/repos/clang/llvm/0013-libc-musl-locale-workarounds.patch
@@ -0,0 +1,40 @@
+From 37a8c7818c4407b6d56ffe14f6f12c53b559f18b Mon Sep 17 00:00:00 2001
+From: q66 <q66@chimera-linux.org>
+Date: Sun, 14 Apr 2024 14:45:36 +0200
+Subject: [PATCH 13/30] libc++: musl locale workarounds
+
+---
+ libcxx/include/locale | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/libcxx/include/locale b/libcxx/include/locale
+index 573910a85..7d610b584 100644
+--- a/libcxx/include/locale
++++ b/libcxx/include/locale
+@@ -727,7 +727,11 @@ __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;
++#if defined(__linux__) && !defined(__GLIBC__)
++ long long __ll = strtoll(__a, &__p2, __base);
++#else
+ long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+ __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+ if (__current_errno == 0)
+ errno = __save_errno;
+@@ -759,7 +763,11 @@ __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;
++#if defined(__linux__) && !defined(__GLIBC__)
++ unsigned long long __ll = strtoull(__a, &__p2, __base);
++#else
+ unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
++#endif
+ __libcpp_remove_reference_t<decltype(errno)> __current_errno = errno;
+ if (__current_errno == 0)
+ errno = __save_errno;
+--
+2.47.0
+