Index: libcxx/include/__locale =================================================================== --- libcxx/include/__locale +++ libcxx/include/__locale @@ -14,7 +14,9 @@ #include <__config> #include #include +#if !defined(_LIBCPP_HAS_NO_LOCALIZATION) #include +#endif #include #include #include Index: libcxx/include/charconv =================================================================== --- libcxx/include/charconv +++ libcxx/include/charconv @@ -93,6 +93,12 @@ #include <__debug> +#if defined(_LIBCPP_HAS_NO_LOCALIZATION) +#include +#else +#include +#endif + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif @@ -426,6 +432,20 @@ return {__r.ptr, errc::result_out_of_range}; } +template +inline _LIBCPP_INLINE_VISIBILITY _Tp +__letter_value(_Tp __c) +{ +#if defined(__MVS__) && !defined(__NATIVE_ASCII_F) + if ('a' <= __c && __c <= 'i') return __c - 'a'; + else if ('j' <= __c && __c <= 'r') return __c - 'j' + 9; + else if ('s' <= __c && __c <= 'z') return __c - 's' + 18; + else return 27; +#else + return __c - 'a'; +#endif +} + template inline _LIBCPP_INLINE_VISIBILITY bool __in_pattern(_Tp __c) @@ -449,10 +469,8 @@ return {'0' <= __c && __c < '0' + __base, __c - '0'}; else if (__in_pattern(__c)) return {true, __c - '0'}; - else if ('a' <= __c && __c < 'a' + __base - 10) - return {true, __c - 'a' + 10}; - else - return {'A' <= __c && __c < 'A' + __base - 10, __c - 'A' + 10}; + __c = _VSTD::tolower(__c); + return {'a' <= __c && __letter_value(__c) < __base - 10, __letter_value(__c) + 10}; } template