@@ -108,11 +108,6 @@ size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len,
108
108
# include < __config>
109
109
# include < stddef.h>
110
110
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
-
116
111
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
117
112
# pragma GCC system_header
118
113
# endif
@@ -142,7 +137,8 @@ size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len,
142
137
# endif
143
138
# endif
144
139
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)
146
142
extern " C++" {
147
143
inline _LIBCPP_HIDE_FROM_ABI wchar_t * __libcpp_wcschr (const wchar_t * __s, wchar_t __c) {
148
144
return (wchar_t *)wcschr (__s, __c);
@@ -197,15 +193,16 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD wchar_t* wmemchr(wchar_t
197
193
return __libcpp_wmemchr (__s, __c, __n);
198
194
}
199
195
}
200
- # endif
196
+ # endif
201
197
202
- # if defined(__cplusplus) && (defined(_LIBCPP_MSVCRT_LIKE) || defined(__MVS__))
198
+ # if defined(__cplusplus) && (defined(_LIBCPP_MSVCRT_LIKE) || defined(__MVS__))
203
199
extern " C" {
204
200
size_t mbsnrtowcs (
205
201
wchar_t * __restrict __dst, const char ** __restrict __src, size_t __nmc, size_t __len, mbstate_t * __restrict __ps);
206
202
size_t wcsnrtombs (
207
203
char * __restrict __dst, const wchar_t ** __restrict __src, size_t __nwc, size_t __len, mbstate_t * __restrict __ps);
208
204
} // extern "C"
209
- # endif // __cplusplus && (_LIBCPP_MSVCRT || __MVS__)
205
+ # endif // __cplusplus && (_LIBCPP_MSVCRT || __MVS__)
206
+ # endif // !_LIBCPP_HAS_NO_WIDE_CHARACTERS
210
207
211
208
#endif // _LIBCPP_WCHAR_H
0 commit comments