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 @@ -89,6 +89,9 @@ #include // for _LIBCPP_UNREACHABLE #include #include +#if !defined(_LIBCPP_HAS_NO_LOCALIZATION) +#include +#endif #include #include <__debug> @@ -426,6 +429,21 @@ return {__r.ptr, errc::result_out_of_range}; } +template +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR _Tp +__LetterNum(_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 +467,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 && __LetterNum(__c) < __base - 10, __LetterNum(__c) + 10}; } template