Index: include/locale =================================================================== --- include/locale +++ include/locale @@ -736,7 +736,11 @@ typename remove_reference::type __save_errno = errno; errno = 0; char *__p2; +#if defined(__ANDROID_API__) && __ANDROID_API__ < 21 + long long __ll = strtoll(__a, &__p2, __base); +#else long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE); +#endif typename remove_reference::type __current_errno = errno; if (__current_errno == 0) errno = __save_errno; @@ -776,7 +780,11 @@ typename remove_reference::type __save_errno = errno; errno = 0; char *__p2; +#if defined(__ANDROID_API__) && __ANDROID_API__ < 21 + unsigned long long __ll = strtoull(__a, &__p2, __base); +#else unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE); +#endif typename remove_reference::type __current_errno = errno; if (__current_errno == 0) errno = __save_errno; @@ -805,19 +813,31 @@ template <> inline _LIBCPP_INLINE_VISIBILITY float __do_strtod(const char* __a, char** __p2) { +#if defined(__ANDROID_API__) && __ANDROID_API__ < 26 + return strtof(__a, __p2); +#else return strtof_l(__a, __p2, _LIBCPP_GET_C_LOCALE); +#endif } template <> inline _LIBCPP_INLINE_VISIBILITY double __do_strtod(const char* __a, char** __p2) { +#if defined(__ANDROID_API__) && __ANDROID_API__ < 26 + return strtod(__a, __p2); +#else return strtod_l(__a, __p2, _LIBCPP_GET_C_LOCALE); +#endif } template <> inline _LIBCPP_INLINE_VISIBILITY long double __do_strtod(const char* __a, char** __p2) { +#if defined(__ANDROID_API__) && __ANDROID_API__ < 26 + return strtold(__a, __p2); +#else return strtold_l(__a, __p2, _LIBCPP_GET_C_LOCALE); +#endif } template