<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">diff --git a/libcxx/include/__mbstate_t.h b/libcxx/include/__mbstate_t.h
index 2b9e719b1f2e..044c10a58c04 100644
--- a/libcxx/include/__mbstate_t.h
+++ b/libcxx/include/__mbstate_t.h
@@ -42,7 +42,10 @@
 #elif __has_include(&lt;bits/types/mbstate_t.h&gt;)
 #   include &lt;bits/types/mbstate_t.h&gt; // works on most Unixes
 #elif __has_include(&lt;sys/_types/_mbstate_t.h&gt;)
-#   include &lt;sys/_types/_mbstate_t.h&gt; // works on Darwin
+#  if __has_include(&lt;machine/_types.h&gt;)
+#    include &lt;machine/_types.h&gt;
+#  endif
+#  include &lt;sys/_types/_mbstate_t.h&gt; // works on Darwin
 #elif !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS) &amp;&amp; __has_include_next(&lt;wchar.h&gt;)
 #   include_next &lt;wchar.h&gt; // fall back to the C standard provider of mbstate_t
 #elif __has_include_next(&lt;uchar.h&gt;)
</pre></body></html>