From 1eb90b9a4e8fa2fbaea71c813b38080b28f66c69 Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Thu, 17 Aug 2023 18:54:22 +0200 Subject: [PATCH] [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 --- libcxx/include/cstdlib | 2 ++ libcxx/include/iosfwd | 2 ++ 2 files changed, 4 insertions(+) diff --git a/libcxx/include/cstdlib b/libcxx/include/cstdlib index ab2c159c7259..9bf0ea3f73b1 100644 --- a/libcxx/include/cstdlib +++ b/libcxx/include/cstdlib @@ -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; diff --git a/libcxx/include/iosfwd b/libcxx/include/iosfwd index ea1a8c0ec372..dbbf7fdaf6de 100644 --- a/libcxx/include/iosfwd +++ b/libcxx/include/iosfwd @@ -121,7 +121,9 @@ template > template class _LIBCPP_TEMPLATE_VIS fpos; typedef fpos streampos; +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS typedef fpos wstreampos; +#endif #ifndef _LIBCPP_HAS_NO_CHAR8_T typedef fpos u8streampos; #endif