Skip to content

Commit ec56790

Browse files
authored
[libcxx] don't #include <cwchar> if wide chars aren't enabled (llvm#99911)
Pull request llvm#96032 unconditionall adds the `cwchar` include in the `format` umbrella header. However support for wchar_t can be disabled in the build system (LIBCXX_ENABLE_WIDE_CHARACTERS). This patch guards against inclusion of `cwchar` in `format` by checking the `_LIBCPP_HAS_NO_WIDE_CHARACTERS` define. For clarity I've also merged the include header section that `cwchar` was in with the one above as they were both guarded by the same `#if` logic.
1 parent cc7308a commit ec56790

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

libcxx/include/format

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,21 +237,21 @@ namespace std {
237237
# include <cstdint>
238238
# include <cstdlib>
239239
# include <cstring>
240-
# include <cwchar>
241240
# include <initializer_list>
242241
# include <limits>
242+
# include <locale>
243243
# include <new>
244244
# include <optional>
245+
# include <queue>
246+
# include <stack>
245247
# include <stdexcept>
246248
# include <string>
247249
# include <string_view>
248250
# include <tuple>
249-
#endif
250251

251-
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
252-
# include <locale>
253-
# include <queue>
254-
# include <stack>
252+
# if !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)
253+
# include <cwchar>
254+
# endif
255255
#endif
256256

257257
#endif // _LIBCPP_FORMAT

0 commit comments

Comments
 (0)