Guard include of uchar.h in stdatomic.h
Bionic stdatomic.h is also used for the host (via a copy in
prebuilts/clang). Revert to guarding the include of uchar.h based on
__STDC_VERSION__, so it is included only when needed.
Change-Id: I5b45c7f5d16da223478512104702a3e4e5a975ae
Test: bionic tests on host and Angler. Confirmed failures I am
seeing are KIs.
diff --git a/libc/include/stdatomic.h b/libc/include/stdatomic.h
index b487fd1..8d573b2 100644
--- a/libc/include/stdatomic.h
+++ b/libc/include/stdatomic.h
@@ -143,7 +143,13 @@
#include <stddef.h> /* For ptrdiff_t. */
#include <stdint.h> /* TODO: don't drag in all the macros, just the types. */
-#include <uchar.h> /* For char16_t and char32_t. */
+// Include uchar.h only when needed. Bionic's stdatomic.h is also used for the
+// host (via a copy in prebuilts/clang) and uchar.h is not available in the
+// glibc used for the host.
+#if __STDC_VERSION__ >= 201112L
+# include <uchar.h> /* For char16_t and char32_t. */
+#endif
+
#ifdef __clang__
# if __has_extension(c_atomic) || __has_extension(cxx_atomic)