@@ -108,11 +108,6 @@ size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len,
108108# include < __config>
109109# include < stddef.h>
110110
111- # if defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)
112- # error \
113- " The <wchar.h> header is not supported since libc++ has been configured with LIBCXX_ENABLE_WIDE_CHARACTERS disabled"
114- # endif
115-
116111# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
117112# pragma GCC system_header
118113# endif
@@ -142,7 +137,8 @@ size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len,
142137# endif
143138# endif
144139
145- # if defined(__cplusplus) && !defined(_LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS) && defined(_LIBCPP_PREFERRED_OVERLOAD)
140+ # ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
141+ # if defined(__cplusplus) && !defined(_LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS) && defined(_LIBCPP_PREFERRED_OVERLOAD)
146142extern " C++" {
147143inline _LIBCPP_HIDE_FROM_ABI wchar_t * __libcpp_wcschr (const wchar_t * __s, wchar_t __c) {
148144 return (wchar_t *)wcschr (__s, __c);
@@ -197,15 +193,16 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD wchar_t* wmemchr(wchar_t
197193 return __libcpp_wmemchr (__s, __c, __n);
198194}
199195}
200- # endif
196+ # endif
201197
202- # if defined(__cplusplus) && (defined(_LIBCPP_MSVCRT_LIKE) || defined(__MVS__))
198+ # if defined(__cplusplus) && (defined(_LIBCPP_MSVCRT_LIKE) || defined(__MVS__))
203199extern " C" {
204200size_t mbsnrtowcs (
205201 wchar_t * __restrict __dst, const char ** __restrict __src, size_t __nmc, size_t __len, mbstate_t * __restrict __ps);
206202size_t wcsnrtombs (
207203 char * __restrict __dst, const wchar_t ** __restrict __src, size_t __nwc, size_t __len, mbstate_t * __restrict __ps);
208204} // extern "C"
209- # endif // __cplusplus && (_LIBCPP_MSVCRT || __MVS__)
205+ # endif // __cplusplus && (_LIBCPP_MSVCRT || __MVS__)
206+ # endif // !_LIBCPP_HAS_NO_WIDE_CHARACTERS
210207
211208#endif // _LIBCPP_WCHAR_H
0 commit comments