diff --git a/libcxx/include/uchar.h b/libcxx/include/uchar.h --- a/libcxx/include/uchar.h +++ b/libcxx/include/uchar.h @@ -41,12 +41,23 @@ #if !defined(_LIBCPP_CXX03_LANG) // Some platforms don't implement and we don't want to give a hard -// error on those platforms. When the platform doesn't provide , at -// least include so we get the declaration for size_t. +// error on those platforms. #if __has_include_next() # include_next #else +// When the platform doesn't provide , try to get the declaration +// for mbstate_t. +# if __has_include() +# include // works on most Unixes +# elif __has_include() +# include // works on Darwin +# elif !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS) +# include_next +#endif + +// Get the declaration for size_t. # include + #endif #endif // _LIBCPP_CXX03_LANG