[libc++] Fixes disabling wide character.

While testing the std module with -DLIBCXX_ENABLE_WIDE_CHARACTERS=OFF
the build failed. These functions are not exported from the module since
they use wchar_t. Disable them in the headers too.

Reviewed By: #libc, philnik

Differential Revision: https://reviews.llvm.org/D158199
This commit is contained in:
Mark de Wever 2023-08-17 18:54:22 +02:00
parent b448fe0c12
commit 1eb90b9a4e
2 changed files with 4 additions and 0 deletions

View File

@ -136,10 +136,12 @@ using ::div _LIBCPP_USING_IF_EXISTS;
using ::ldiv _LIBCPP_USING_IF_EXISTS;
using ::lldiv _LIBCPP_USING_IF_EXISTS;
using ::mblen _LIBCPP_USING_IF_EXISTS;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
using ::mbtowc _LIBCPP_USING_IF_EXISTS;
using ::wctomb _LIBCPP_USING_IF_EXISTS;
using ::mbstowcs _LIBCPP_USING_IF_EXISTS;
using ::wcstombs _LIBCPP_USING_IF_EXISTS;
#endif
#if !defined(_LIBCPP_CXX03_LANG)
using ::at_quick_exit _LIBCPP_USING_IF_EXISTS;
using ::quick_exit _LIBCPP_USING_IF_EXISTS;

View File

@ -121,7 +121,9 @@ template <class _CharT, class _Traits = char_traits<_CharT> >
template <class _State> class _LIBCPP_TEMPLATE_VIS fpos;
typedef fpos<mbstate_t> streampos;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
typedef fpos<mbstate_t> wstreampos;
#endif
#ifndef _LIBCPP_HAS_NO_CHAR8_T
typedef fpos<mbstate_t> u8streampos;
#endif