Skip to content

Commit

Permalink
[libcxx] don't #include <cwchar> if wide chars aren't enabled
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
stuij committed Jul 22, 2024
1 parent bc4c3bf commit b39ab98
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions libcxx/include/format
Original file line number Diff line number Diff line change
Expand Up @@ -237,21 +237,21 @@ namespace std {
# include <cstdint>
# include <cstdlib>
# include <cstring>
# include <cwchar>
# include <initializer_list>
# include <limits>
# include <locale>
# include <new>
# include <optional>
# include <queue>
# include <stack>
# include <stdexcept>
# include <string>
# include <string_view>
# include <tuple>
#endif

#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <locale>
# include <queue>
# include <stack>
#if !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)
# include <cwchar>
#endif
#endif

#endif // _LIBCPP_FORMAT

0 comments on commit b39ab98

Please sign in to comment.