61 lines
2.3 KiB
Diff
61 lines
2.3 KiB
Diff
--- a/include/locale
|
|
+++ b/include/locale
|
|
@@ -10,7 +10,6 @@
|
|
|
|
#ifndef _LIBCPP_LOCALE
|
|
#define _LIBCPP_LOCALE
|
|
-
|
|
/*
|
|
locale synopsis
|
|
|
|
@@ -871,7 +870,7 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
|
|
typename remove_reference<decltype(errno)>::type __save_errno = errno;
|
|
errno = 0;
|
|
char *__p2;
|
|
- long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
|
|
+ long long __ll = strtoll(__a, &__p2, __base);
|
|
typename remove_reference<decltype(errno)>::type __current_errno = errno;
|
|
if (__current_errno == 0)
|
|
errno = __save_errno;
|
|
@@ -911,7 +910,7 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
|
|
typename remove_reference<decltype(errno)>::type __save_errno = errno;
|
|
errno = 0;
|
|
char *__p2;
|
|
- unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE);
|
|
+ unsigned long long __ll = strtoull(__a, &__p2, __base);
|
|
typename remove_reference<decltype(errno)>::type __current_errno = errno;
|
|
if (__current_errno == 0)
|
|
errno = __save_errno;
|
|
--- a/src/locale.cpp
|
|
+++ b/src/locale.cpp
|
|
@@ -1010,7 +1010,7 @@ ctype<char>::do_narrow(const char_type* low, const char_type* high, char dfault,
|
|
return low;
|
|
}
|
|
|
|
-#if defined(__EMSCRIPTEN__)
|
|
+#ifdef __linux__
|
|
extern "C" const unsigned short ** __ctype_b_loc();
|
|
extern "C" const int ** __ctype_tolower_loc();
|
|
extern "C" const int ** __ctype_toupper_loc();
|
|
@@ -1112,20 +1112,8 @@ ctype<char>::classic_table() _NOEXCEPT
|
|
return _ctype+1; // internal ctype mask table defined in msvcrt.dll
|
|
// This is assumed to be safe, which is a nonsense assumption because we're
|
|
// going to end up dereferencing it later...
|
|
-#elif defined(__EMSCRIPTEN__)
|
|
- return *__ctype_b_loc();
|
|
-#elif defined(_NEWLIB_VERSION)
|
|
- // Newlib has a 257-entry table in ctype_.c, where (char)0 starts at [1].
|
|
- return _ctype_ + 1;
|
|
-#elif defined(_AIX)
|
|
- return (const unsigned int *)__lc_ctype_ptr->obj->mask;
|
|
#else
|
|
- // Platform not supported: abort so the person doing the port knows what to
|
|
- // fix
|
|
-# warning ctype<char>::classic_table() is not implemented
|
|
- printf("ctype<char>::classic_table() is not implemented\n");
|
|
- abort();
|
|
- return NULL;
|
|
+ return (const unsigned long *)*__ctype_b_loc();
|
|
#endif
|
|
}
|
|
#endif
|