From ed3c78771fbd8fa70b7703ba0b98f64cf9c42462 Mon Sep 17 00:00:00 2001 From: Pirama Arumuga Nainar Date: Thu, 4 Aug 2016 09:40:18 -0700 Subject: [PATCH] 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. --- libc/include/stdatomic.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libc/include/stdatomic.h b/libc/include/stdatomic.h index b487fd100..8d573b263 100644 --- a/libc/include/stdatomic.h +++ b/libc/include/stdatomic.h @@ -143,7 +143,13 @@ using std::atomic_uintmax_t; #include /* For ptrdiff_t. */ #include /* TODO: don't drag in all the macros, just the types. */ -#include /* 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 /* For char16_t and char32_t. */ +#endif + #ifdef __clang__ # if __has_extension(c_atomic) || __has_extension(cxx_atomic)