[libcxx-commits] [PATCH] D151740: [libc++] Include "bits/alltypes.h" to provide mbstate_t when using musl libc

Pengxuan Zheng via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue May 30 17:59:51 PDT 2023


This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was automatically updated to reflect the committed changes.
pzheng marked an inline comment as done.
Closed by commit rGfef23e8d871a: [libc++] Include "bits/alltypes.h" to provide mbstate_t when using musl libc (authored by pzheng).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151740/new/

https://reviews.llvm.org/D151740

Files:
  libcxx/include/__mbstate_t.h


Index: libcxx/include/__mbstate_t.h
===================================================================
--- libcxx/include/__mbstate_t.h
+++ libcxx/include/__mbstate_t.h
@@ -35,7 +35,11 @@
 #  define __CORRECT_ISO_CPP_WCHAR_H_PROTO
 #endif
 
-#if __has_include(<bits/types/mbstate_t.h>)
+#if defined(_LIBCPP_HAS_MUSL_LIBC)
+#   define __NEED_mbstate_t
+#   include <bits/alltypes.h>
+#   undef __NEED_mbstate_t
+#elif __has_include(<bits/types/mbstate_t.h>)
 #   include <bits/types/mbstate_t.h> // works on most Unixes
 #elif __has_include(<sys/_types/_mbstate_t.h>)
 #   include <sys/_types/_mbstate_t.h> // works on Darwin


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151740.526859.patch
Type: text/x-patch
Size: 626 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230531/86307759/attachment.bin>


More information about the libcxx-commits mailing list