[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>
This commit is contained in:
Brian Cain 2025-02-27 21:49:19 -06:00 committed by GitHub
parent 0b5bb12534
commit 39c6c8be2f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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
}
//