[libcxx-commits] [libcxx] 1eb90b9 - [libc++] Fixes disabling wide character.
Mark de Wever via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Aug 19 10:09:22 PDT 2023
Author: Mark de Wever
Date: 2023-08-19T19:09:16+02:00
New Revision: 1eb90b9a4e8fa2fbaea71c813b38080b28f66c69
URL: https://github.com/llvm/llvm-project/commit/1eb90b9a4e8fa2fbaea71c813b38080b28f66c69
DIFF: https://github.com/llvm/llvm-project/commit/1eb90b9a4e8fa2fbaea71c813b38080b28f66c69.diff
LOG: [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
Added:
Modified:
libcxx/include/cstdlib
libcxx/include/iosfwd
Removed:
################################################################################
diff --git a/libcxx/include/cstdlib b/libcxx/include/cstdlib
index ab2c159c7259a3..9bf0ea3f73b169 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 ea1a8c0ec37211..dbbf7fdaf6de4b 100644
--- a/libcxx/include/iosfwd
+++ b/libcxx/include/iosfwd
@@ -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
More information about the libcxx-commits
mailing list