Index: include/locale =================================================================== --- include/locale +++ include/locale @@ -1191,7 +1191,7 @@ #ifdef _LIBCPP_LOCALE__L_EXTENSIONS if (sscanf_l(__buf.c_str(), _LIBCPP_GET_C_LOCALE, "%p", &__v) != 1) #else - if (__sscanf_l(__buf.c_str(), __cloc(), "%p", &__v) != 1) + if (__sscanf_l(__buf.c_str(), _LIBCPP_GET_C_LOCALE, "%p", &__v) != 1) #endif __err = ios_base::failbit; // EOF checked @@ -1561,7 +1561,7 @@ #ifdef _LIBCPP_LOCALE__L_EXTENSIONS int __nc = snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v); #else - int __nc = __snprintf_l(__nar, sizeof(__nar), __cloc(), __fmt, __v); + int __nc = __snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v); #endif char* __ne = __nar + __nc; char* __np = this->__identify_padding(__nar, __ne, __iob); @@ -1591,7 +1591,7 @@ #ifdef _LIBCPP_LOCALE__L_EXTENSIONS int __nc = snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v); #else - int __nc = __snprintf_l(__nar, sizeof(__nar), __cloc(), __fmt, __v); + int __nc = __snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v); #endif char* __ne = __nar + __nc; char* __np = this->__identify_padding(__nar, __ne, __iob); @@ -1621,7 +1621,7 @@ #ifdef _LIBCPP_LOCALE__L_EXTENSIONS int __nc = snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v); #else - int __nc = __snprintf_l(__nar, sizeof(__nar), __cloc(), __fmt, __v); + int __nc = __snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v); #endif char* __ne = __nar + __nc; char* __np = this->__identify_padding(__nar, __ne, __iob); @@ -1651,7 +1651,7 @@ #ifdef _LIBCPP_LOCALE__L_EXTENSIONS int __nc = snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v); #else - int __nc = __snprintf_l(__nar, sizeof(__nar), __cloc(), __fmt, __v); + int __nc = __snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v); #endif char* __ne = __nar + __nc; char* __np = this->__identify_padding(__nar, __ne, __iob); @@ -1683,14 +1683,14 @@ __nc = snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt, (int)__iob.precision(), __v); #else - __nc = __snprintf_l(__nb, __nbuf, __cloc(), __fmt, - (int)__iob.precision(), __v); + __nc = __snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt, + (int)__iob.precision(), __v); #endif else #ifdef _LIBCPP_LOCALE__L_EXTENSIONS __nc = snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt, __v); #else - __nc = __snprintf_l(__nb, __nbuf, __cloc(), __fmt, __v); + __nc = __snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt, __v); #endif unique_ptr __nbh(0, free); if (__nc > static_cast(__nbuf-1)) @@ -1699,14 +1699,13 @@ #ifdef _LIBCPP_LOCALE__L_EXTENSIONS __nc = asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, (int)__iob.precision(), __v); #else - __nc = __asprintf_l(&__nb, __cloc(), __fmt, - (int)__iob.precision(), __v); + __nc = __asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, (int)__iob.precision(), __v); #endif else #ifdef _LIBCPP_LOCALE__L_EXTENSIONS __nc = asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, __v); #else - __nc = __asprintf_l(&__nb, __cloc(), __fmt, (int)__iob.precision(), __v); + __nc = __asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, (int)__iob.precision(), __v); #endif if (__nb == 0) __throw_bad_alloc(); @@ -1752,14 +1751,14 @@ __nc = snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt, (int)__iob.precision(), __v); #else - __nc = __snprintf_l(__nb, __nbuf, __cloc(), __fmt, - (int)__iob.precision(), __v); + __nc = __snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt, + (int)__iob.precision(), __v); #endif else #ifdef _LIBCPP_LOCALE__L_EXTENSIONS __nc = snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt, __v); #else - __nc = __snprintf_l(__nb, __nbuf, __cloc(), __fmt, __v); + __nc = __snprintf_l(__nb, __nbuf, _LIBCPP_GET_C_LOCALE, __fmt, __v); #endif unique_ptr __nbh(0, free); if (__nc > static_cast(__nbuf-1)) @@ -1768,14 +1767,13 @@ #ifdef _LIBCPP_LOCALE__L_EXTENSIONS __nc = asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, (int)__iob.precision(), __v); #else - __nc = __asprintf_l(&__nb, __cloc(), __fmt, - (int)__iob.precision(), __v); + __nc = __asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, (int)__iob.precision(), __v); #endif else #ifdef _LIBCPP_LOCALE__L_EXTENSIONS __nc = asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, __v); #else - __nc = __asprintf_l(&__nb, __cloc(), __fmt, __v); + __nc = __asprintf_l(&__nb, _LIBCPP_GET_C_LOCALE, __fmt, __v); #endif if (__nb == 0) __throw_bad_alloc(); @@ -1815,7 +1813,7 @@ #ifdef _LIBCPP_LOCALE__L_EXTENSIONS int __nc = snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v); #else - int __nc = __snprintf_l(__nar, sizeof(__nar), __cloc(), __fmt, __v); + int __nc = __snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v); #endif char* __ne = __nar + __nc; char* __np = this->__identify_padding(__nar, __ne, __iob); @@ -3528,7 +3526,7 @@ #ifdef _LIBCPP_LOCALE__L_EXTENSIONS __n = static_cast(asprintf_l(&__bb, _LIBCPP_GET_C_LOCALE, "%.0Lf", __units)); #else - __n = __asprintf_l(&__bb, __cloc(), "%.0Lf", __units); + __n = __asprintf_l(&__bb, _LIBCPP_GET_C_LOCALE, "%.0Lf", __units); #endif if (__bb == 0) __throw_bad_alloc(); Index: src/locale.cpp =================================================================== --- src/locale.cpp +++ src/locale.cpp @@ -813,7 +813,7 @@ #elif defined(__GLIBC__) || defined(__EMSCRIPTEN__) || defined(__NetBSD__) return isascii(c) ? ctype::__classic_upper_table()[c] : c; #else - return (isascii(c) && iswlower_l(c, __cloc())) ? c-L'a'+L'A' : c; + return (isascii(c) && iswlower_l(c, _LIBCPP_GET_C_LOCALE)) ? c-L'a'+L'A' : c; #endif } @@ -827,7 +827,7 @@ *low = isascii(*low) ? ctype::__classic_upper_table()[*low] : *low; #else - *low = (isascii(*low) && islower_l(*low, __cloc())) ? (*low-L'a'+L'A') : *low; + *low = (isascii(*low) && islower_l(*low, _LIBCPP_GET_C_LOCALE)) ? (*low-L'a'+L'A') : *low; #endif return low; } @@ -840,7 +840,7 @@ #elif defined(__GLIBC__) || defined(__EMSCRIPTEN__) || defined(__NetBSD__) return isascii(c) ? ctype::__classic_lower_table()[c] : c; #else - return (isascii(c) && isupper_l(c, __cloc())) ? c-L'A'+'a' : c; + return (isascii(c) && isupper_l(c, _LIBCPP_GET_C_LOCALE)) ? c-L'A'+'a' : c; #endif } @@ -854,7 +854,7 @@ *low = isascii(*low) ? ctype::__classic_lower_table()[*low] : *low; #else - *low = (isascii(*low) && isupper_l(*low, __cloc())) ? *low-L'A'+L'a' : *low; + *low = (isascii(*low) && isupper_l(*low, _LIBCPP_GET_C_LOCALE)) ? *low-L'A'+L'a' : *low; #endif return low; } @@ -923,7 +923,7 @@ return isascii(c) ? static_cast(__classic_upper_table()[static_cast(c)]) : c; #else - return (isascii(c) && islower_l(c, __cloc())) ? c-'a'+'A' : c; + return (isascii(c) && islower_l(c, _LIBCPP_GET_C_LOCALE)) ? c-'a'+'A' : c; #endif } @@ -940,7 +940,7 @@ *low = isascii(*low) ? static_cast(__classic_upper_table()[static_cast(*low)]) : *low; #else - *low = (isascii(*low) && islower_l(*low, __cloc())) ? *low-'a'+'A' : *low; + *low = (isascii(*low) && islower_l(*low, _LIBCPP_GET_C_LOCALE)) ? *low-'a'+'A' : *low; #endif return low; } @@ -957,7 +957,7 @@ return isascii(c) ? static_cast(__classic_lower_table()[static_cast(c)]) : c; #else - return (isascii(c) && isupper_l(c, __cloc())) ? c-'A'+'a' : c; + return (isascii(c) && isupper_l(c, _LIBCPP_GET_C_LOCALE)) ? c-'A'+'a' : c; #endif } @@ -972,7 +972,7 @@ #elif defined(__GLIBC__) || defined(__EMSCRIPTEN__) *low = isascii(*low) ? static_cast(__classic_lower_table()[static_cast(*low)]) : *low; #else - *low = (isascii(*low) && isupper_l(*low, __cloc())) ? *low-'A'+'a' : *low; + *low = (isascii(*low) && isupper_l(*low, _LIBCPP_GET_C_LOCALE)) ? *low-'A'+'a' : *low; #endif return low; } @@ -1105,7 +1105,7 @@ #elif defined(__NetBSD__) return _C_ctype_tab_ + 1; #elif defined(__GLIBC__) - return __cloc()->__ctype_b; + return _LIBCPP_GET_C_LOCALE->__ctype_b; #elif __sun__ return __ctype_mask; #elif defined(_LIBCPP_MSVCRT) || defined(__MINGW32__) @@ -1134,13 +1134,13 @@ const int* ctype::__classic_lower_table() _NOEXCEPT { - return __cloc()->__ctype_tolower; + return _LIBCPP_GET_C_LOCALE->__ctype_tolower; } const int* ctype::__classic_upper_table() _NOEXCEPT { - return __cloc()->__ctype_toupper; + return _LIBCPP_GET_C_LOCALE->__ctype_toupper; } #elif __NetBSD__ const short*