[libcxx-commits] [libcxx] 5320cc5 - [libc++] Update `__mbstate_t.h` to include path to Android's `mbstate_t.h` (#192307)

via libcxx-commits libcxx-commits at lists.llvm.org
Mon Apr 20 12:56:41 PDT 2026


Author: finagolfin
Date: 2026-04-20T12:56:36-07:00
New Revision: 5320cc50b6b4e3684ff4ba93a5c2c2429c09386b

URL: https://github.com/llvm/llvm-project/commit/5320cc50b6b4e3684ff4ba93a5c2c2429c09386b
DIFF: https://github.com/llvm/llvm-project/commit/5320cc50b6b4e3684ff4ba93a5c2c2429c09386b.diff

LOG: [libc++] Update `__mbstate_t.h` to include path to Android's `mbstate_t.h` (#192307)

Ever since ce4ac9945 started including `__mbstate_t.h` in this C++
`wchar.h`, the Android NDK sees some redefinition errors with
`-fmodules`, likely because this Android `mbstate_t.h` was not included.
Elliot, enh-google from the Android team, 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. This fixes
android/ndk#2230, once it gets into the NDK sysroot.

Added: 
    

Modified: 
    libcxx/include/__mbstate_t.h

Removed: 
    


################################################################################
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>)


        


More information about the libcxx-commits mailing list