diff --git a/libcxx/include/__support/xlocale/__nop_locale_mgmt.h b/libcxx/include/__support/xlocale/__nop_locale_mgmt.h --- a/libcxx/include/__support/xlocale/__nop_locale_mgmt.h +++ b/libcxx/include/__support/xlocale/__nop_locale_mgmt.h @@ -10,6 +10,8 @@ #ifndef _LIBCPP_SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H #define _LIBCPP_SUPPORT_XLOCALE_NOP_LOCALE_MGMT_H +#include <__config> + #ifdef __cplusplus extern "C" { #endif diff --git a/libcxx/include/__support/xlocale/__posix_l_fallback.h b/libcxx/include/__support/xlocale/__posix_l_fallback.h --- a/libcxx/include/__support/xlocale/__posix_l_fallback.h +++ b/libcxx/include/__support/xlocale/__posix_l_fallback.h @@ -15,6 +15,14 @@ #ifndef _LIBCPP_SUPPORT_XLOCALE_POSIX_L_FALLBACK_H #define _LIBCPP_SUPPORT_XLOCALE_POSIX_L_FALLBACK_H +#include <__config> +#include +#include + +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +# include +#endif + #ifdef __cplusplus extern "C" { #endif @@ -67,6 +75,15 @@ return ::isxdigit(__c); } +inline _LIBCPP_HIDE_FROM_ABI int toupper_l(int __c, locale_t) { + return ::toupper(__c); +} + +inline _LIBCPP_HIDE_FROM_ABI int tolower_l(int __c, locale_t) { + return ::tolower(__c); +} + +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS inline _LIBCPP_HIDE_FROM_ABI int iswalnum_l(wint_t __c, locale_t) { return ::iswalnum(__c); } @@ -115,14 +132,6 @@ return ::iswxdigit(__c); } -inline _LIBCPP_HIDE_FROM_ABI int toupper_l(int __c, locale_t) { - return ::toupper(__c); -} - -inline _LIBCPP_HIDE_FROM_ABI int tolower_l(int __c, locale_t) { - return ::tolower(__c); -} - inline _LIBCPP_HIDE_FROM_ABI wint_t towupper_l(wint_t __c, locale_t) { return ::towupper(__c); } @@ -130,6 +139,7 @@ inline _LIBCPP_HIDE_FROM_ABI wint_t towlower_l(wint_t __c, locale_t) { return ::towlower(__c); } +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS inline _LIBCPP_HIDE_FROM_ABI int strcoll_l(const char *__s1, const char *__s2, locale_t) { @@ -147,6 +157,7 @@ return ::strftime(__s, __max, __format, __tm); } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS inline _LIBCPP_HIDE_FROM_ABI int wcscoll_l(const wchar_t *__ws1, const wchar_t *__ws2, locale_t) { return ::wcscoll(__ws1, __ws2); @@ -156,6 +167,7 @@ wcsxfrm_l(wchar_t *__dest, const wchar_t *__src, size_t __n, locale_t) { return ::wcsxfrm(__dest, __src, __n); } +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS #ifdef __cplusplus } diff --git a/libcxx/include/__support/xlocale/__strtonum_fallback.h b/libcxx/include/__support/xlocale/__strtonum_fallback.h --- a/libcxx/include/__support/xlocale/__strtonum_fallback.h +++ b/libcxx/include/__support/xlocale/__strtonum_fallback.h @@ -15,6 +15,13 @@ #ifndef _LIBCPP_SUPPORT_XLOCALE_STRTONUM_FALLBACK_H #define _LIBCPP_SUPPORT_XLOCALE_STRTONUM_FALLBACK_H +#include <__config> +#include + +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +# include +#endif + #ifdef __cplusplus extern "C" { #endif @@ -44,6 +51,7 @@ return ::strtoull(__nptr, __endptr, __base); } +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS inline _LIBCPP_HIDE_FROM_ABI long long wcstoll_l(const wchar_t *__nptr, wchar_t **__endptr, int __base, locale_t) { return ::wcstoll(__nptr, __endptr, __base); @@ -58,6 +66,7 @@ wcstold_l(const wchar_t *__nptr, wchar_t **__endptr, locale_t) { return ::wcstold(__nptr, __endptr); } +#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS #ifdef __cplusplus }