diff --git a/libcxx/include/__support/android/locale_bionic.h b/libcxx/include/__support/android/locale_bionic.h --- a/libcxx/include/__support/android/locale_bionic.h +++ b/libcxx/include/__support/android/locale_bionic.h @@ -58,6 +58,10 @@ return ::strtol(__nptr, __endptr, __base); } +inline _LIBCPP_HIDE_FROM_ABI_C unsigned long strtoul_l(const char* __nptr, char** __endptr, int __base, locale_t) { + return ::strtoul(__nptr, __endptr, __base); +} + #if defined(__cplusplus) } #endif diff --git a/libcxx/include/__support/musl/xlocale.h b/libcxx/include/__support/musl/xlocale.h --- a/libcxx/include/__support/musl/xlocale.h +++ b/libcxx/include/__support/musl/xlocale.h @@ -24,10 +24,19 @@ extern "C" { #endif +inline _LIBCPP_HIDE_FROM_ABI_C long strtol_l(const char* __nptr, char** __endptr, int __base, locale_t) { + return ::strtol(__nptr, __endptr, __base); +} + inline _LIBCPP_HIDE_FROM_ABI_C long long strtoll_l(const char* __nptr, char** __endptr, int __base, locale_t) { return ::strtoll(__nptr, __endptr, __base); } +inline _LIBCPP_HIDE_FROM_ABI_C unsigned long +strtoul_l(const char* __nptr, char** __endptr, int __base, locale_t) { + return ::strtoul(__nptr, __endptr, __base); +} + inline _LIBCPP_HIDE_FROM_ABI_C unsigned long long strtoull_l(const char* __nptr, char** __endptr, int __base, locale_t) { return ::strtoull(__nptr, __endptr, __base); diff --git a/libcxx/include/__support/openbsd/xlocale.h b/libcxx/include/__support/openbsd/xlocale.h --- a/libcxx/include/__support/openbsd/xlocale.h +++ b/libcxx/include/__support/openbsd/xlocale.h @@ -16,20 +16,4 @@ #include #include -#ifdef __cplusplus -extern "C" { -#endif - -inline _LIBCPP_HIDE_FROM_ABI_C long strtol_l(const char* __nptr, char** __endptr, int __base, locale_t) { - return ::strtol(__nptr, __endptr, __base); -} - -inline _LIBCPP_HIDE_FROM_ABI_C unsigned long strtoul_l(const char* __nptr, char** __endptr, int __base, locale_t) { - return ::strtoul(__nptr, __endptr, __base); -} - -#ifdef __cplusplus -} -#endif - #endif diff --git a/libcxx/include/__support/win32/locale_win32.h b/libcxx/include/__support/win32/locale_win32.h --- a/libcxx/include/__support/win32/locale_win32.h +++ b/libcxx/include/__support/win32/locale_win32.h @@ -214,7 +214,9 @@ // the *_l functions are prefixed on Windows, only available for msvcr80+, VS2005+ #define mbtowc_l _mbtowc_l +#define strtol_l _strtol_l #define strtoll_l _strtoi64_l +#define strtoul_l _strtoul_l #define strtoull_l _strtoui64_l #define strtod_l _strtod_l #if defined(_LIBCPP_MSVCRT) diff --git a/libcxx/include/__support/xlocale/__strtonum_fallback.h b/libcxx/include/__support/xlocale/__strtonum_fallback.h --- a/libcxx/include/__support/xlocale/__strtonum_fallback.h +++ b/libcxx/include/__support/xlocale/__strtonum_fallback.h @@ -38,10 +38,19 @@ return ::strtold(__nptr, __endptr); } +inline _LIBCPP_HIDE_FROM_ABI_C long strtol_l(const char* __nptr, char** __endptr, int __base, locale_t) { + return ::strtol(__nptr, __endptr, __base); +} + inline _LIBCPP_HIDE_FROM_ABI_C long long strtoll_l(const char* __nptr, char** __endptr, int __base, locale_t) { return ::strtoll(__nptr, __endptr, __base); } +inline _LIBCPP_HIDE_FROM_ABI_C unsigned long +strtoul_l(const char* __nptr, char** __endptr, int __base, locale_t) { + return ::strtoul(__nptr, __endptr, __base); +} + inline _LIBCPP_HIDE_FROM_ABI_C unsigned long long strtoull_l(const char* __nptr, char** __endptr, int __base, locale_t) { return ::strtoull(__nptr, __endptr, __base);