From 76e2b15ad42bba62b8f9ac98885e5465f866de11 Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Thu, 18 Jul 2019 13:15:47 -0700 Subject: Change stdatomic.h check from defined(_USING_LIBCXX) to __has_include() The previous check was causing some problems with platform builds using the NDK. The new check is more accurate. Move the C definitions from stdatomic.h to bits/stdatomic.h since with the new check, we no longer can use the #undef trick to test them. Test: build platform NDK with stdatomic.h in pthread.h header Test: stdatomic bionic-unit-tests Change-Id: Ia0bc3cc8344f2ba4e6e55a52248fb6efee799d1d --- tests/stdatomic_test.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tests/stdatomic_test.cpp') diff --git a/tests/stdatomic_test.cpp b/tests/stdatomic_test.cpp index d122d2f39..a9665d18e 100644 --- a/tests/stdatomic_test.cpp +++ b/tests/stdatomic_test.cpp @@ -15,9 +15,14 @@ */ #include -// Fool stdatomic.h into not using . -#undef _USING_LIBCXX + +#if defined(__ANDROID__) +#include +#else +#undef _USING_LIBCXX //TODO(b/137876753): Remove this #include +#endif + #include #include -- cgit v1.2.3