[libcxx-commits] [PATCH] D158199: [libc++] Fixes disabling wide character.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Aug 17 09:56:54 PDT 2023


Mordante created this revision.
Mordante added a reviewer: ldionne.
Herald added a project: All.
Mordante requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D158199

Files:
  libcxx/include/cstdlib
  libcxx/include/iosfwd


Index: libcxx/include/iosfwd
===================================================================
--- libcxx/include/iosfwd
+++ libcxx/include/iosfwd
@@ -121,7 +121,9 @@
 
 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
Index: libcxx/include/cstdlib
===================================================================
--- libcxx/include/cstdlib
+++ libcxx/include/cstdlib
@@ -135,11 +135,13 @@
 using ::div _LIBCPP_USING_IF_EXISTS;
 using ::ldiv _LIBCPP_USING_IF_EXISTS;
 using ::lldiv _LIBCPP_USING_IF_EXISTS;
+#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
 using ::mblen _LIBCPP_USING_IF_EXISTS;
 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;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158199.551179.patch
Type: text/x-patch
Size: 1123 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230817/f0725866/attachment.bin>


More information about the libcxx-commits mailing list