Skip to content

Commit 6df2914

Browse files
committed
disable STL wchar_t functions (but keep the C headers)
1 parent 80b085e commit 6df2914

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

src/libcxx/header_test.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,11 @@
171171
#include <variant>
172172
#include <vector>
173173
#include <version>
174-
#if !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)
174+
// We can still provide some of the functions in <wchar.h> without issues
175+
#if 1 || !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)
175176
# include <wchar.h>
176177
#endif
177-
#if !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)
178+
#if 1 || !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)
178179
# include <wctype.h>
179180
#endif
180181

src/libcxx/include/__config_site

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#define _LIBCPP_HAS_NO_RANDOM_DEVICE
2828
#define _LIBCPP_HAS_NO_LOCALIZATION
2929
#define _LIBCPP_HAS_NO_UNICODE
30-
// #define _LIBCPP_HAS_NO_WIDE_CHARACTERS
30+
#define _LIBCPP_HAS_NO_WIDE_CHARACTERS
3131
#define _LIBCPP_HAS_NO_STD_MODULES
3232
#define _LIBCPP_HAS_NO_TIME_ZONE_DATABASE
3333
// #define _LIBCPP_INSTRUMENTED_WITH_ASAN

src/libcxx/include/wchar.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,12 @@ size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len,
108108
# include <__config>
109109
# include <stddef.h>
110110

111+
#ifndef _EZ80
111112
# if defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)
112113
# error \
113114
"The <wchar.h> header is not supported since libc++ has been configured with LIBCXX_ENABLE_WIDE_CHARACTERS disabled"
114115
# endif
116+
#endif // _EZ80
115117

116118
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
117119
# pragma GCC system_header

src/libcxx/include/wctype.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,12 @@ wctrans_t wctrans(const char* property);
4646

4747
#include <__config>
4848

49+
#ifndef _EZ80
4950
#if defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)
5051
# error \
5152
"The <wctype.h> header is not supported since libc++ has been configured with LIBCXX_ENABLE_WIDE_CHARACTERS disabled"
5253
#endif
54+
#endif // _EZ80
5355

5456
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
5557
# pragma GCC system_header

0 commit comments

Comments
 (0)