aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Cain <brian.cain@oss.qualcomm.com>2025-02-27 21:49:19 -0600
committerGitHub <noreply@github.com>2025-02-27 22:49:19 -0500
commit39c6c8be2f3f607b413e3f05ab1f4678efdd129a (patch)
tree0ee083c9b3f2da89d2c9f2b2207888021996180d
parent0b5bb12534fe95441c1898f345ec867a3ca7c4b0 (diff)
downloadllvm-39c6c8be2f3f607b413e3f05ab1f4678efdd129a.zip
llvm-39c6c8be2f3f607b413e3f05ab1f4678efdd129a.tar.gz
llvm-39c6c8be2f3f607b413e3f05ab1f4678efdd129a.tar.bz2
[libc++] Fix the locale base API on Linux with musl (#128936)
Since `363bfd6090b0 ([libc++] Use the new locale base API on Linux (#128007), 2025-02-24)`, musl targets will fail to build with errors due to missing strtoll_l functions. Co-authored-by: Pirama Arumuga Nainar <pirama@google.com>
-rw-r--r--libcxx/include/__locale_dir/support/linux.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/libcxx/include/__locale_dir/support/linux.h b/libcxx/include/__locale_dir/support/linux.h
index f1662c01..fa0b03c 100644
--- a/libcxx/include/__locale_dir/support/linux.h
+++ b/libcxx/include/__locale_dir/support/linux.h
@@ -95,12 +95,22 @@ inline _LIBCPP_HIDE_FROM_ABI long double __strtold(const char* __nptr, char** __
}
inline _LIBCPP_HIDE_FROM_ABI long long __strtoll(const char* __nptr, char** __endptr, int __base, __locale_t __loc) {
+#if !_LIBCPP_HAS_MUSL_LIBC
return ::strtoll_l(__nptr, __endptr, __base, __loc);
+#else
+ (void)__loc;
+ return ::strtoll(__nptr, __endptr, __base);
+#endif
}
inline _LIBCPP_HIDE_FROM_ABI unsigned long long
__strtoull(const char* __nptr, char** __endptr, int __base, __locale_t __loc) {
+#if !_LIBCPP_HAS_MUSL_LIBC
return ::strtoull_l(__nptr, __endptr, __base, __loc);
+#else
+ (void)__loc;
+ return ::strtoull(__nptr, __endptr, __base);
+#endif
}
//