[libcxx-commits] [libcxx] [libc++] Update `__mbstate_t.h` to include path to Android's `mbstate_t.h` (PR #192307)
via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Apr 15 11:35:39 PDT 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libcxx
Author: finagolfin
<details>
<summary>Changes</summary>
Ever since ce4ac9945 started including `__mbstate_t.h` in this C++ `wchar.h`, the Android NDK sees redefinition errors, likely because this Android `mbstate_t.h` was not included. @<!-- -->enh-google suggested this inclusion to fix it, and it worked for me in my local testing: see swiftlang/swift#<!-- -->85365 for the errors and more info.
---
Full diff: https://github.com/llvm/llvm-project/pull/192307.diff
1 Files Affected:
- (modified) libcxx/include/__mbstate_t.h (+2)
``````````diff
diff --git a/libcxx/include/__mbstate_t.h b/libcxx/include/__mbstate_t.h
index c23ea7113ca70..d331ba622d37f 100644
--- a/libcxx/include/__mbstate_t.h
+++ b/libcxx/include/__mbstate_t.h
@@ -43,6 +43,8 @@
# 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
+#elif __has_include(<bits/mbstate_t.h>)
+# include <bits/mbstate_t.h> // works for Android
#elif __has_include_next(<wchar.h>)
# include_next <wchar.h> // use the C standard provider of mbstate_t if present
#elif __has_include_next(<uchar.h>)
``````````
</details>
https://github.com/llvm/llvm-project/pull/192307
More information about the libcxx-commits
mailing list