summaryrefslogtreecommitdiff
path: root/tests/stdatomic_test.cpp
diff options
context:
space:
mode:
authorTom Cherry <tomcherry@google.com>2019-07-18 13:15:47 -0700
committerTom Cherry <tomcherry@google.com>2019-07-18 13:57:39 -0700
commit76e2b15ad42bba62b8f9ac98885e5465f866de11 (patch)
tree2dc22703a65099f5a48a18e2d342cda5b89f1f74 /tests/stdatomic_test.cpp
parent9cf76012aa5edc11050920ab1b65817c1be1a112 (diff)
Change stdatomic.h check from defined(_USING_LIBCXX) to __has_include(<atomic>)
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
Diffstat (limited to 'tests/stdatomic_test.cpp')
-rw-r--r--tests/stdatomic_test.cpp9
1 files changed, 7 insertions, 2 deletions
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 <gtest/gtest.h>
-// Fool stdatomic.h into not using <atomic>.
-#undef _USING_LIBCXX
+
+#if defined(__ANDROID__)
+#include <bits/stdatomic.h>
+#else
+#undef _USING_LIBCXX //TODO(b/137876753): Remove this
#include <stdatomic.h>
+#endif
+
#include <pthread.h>
#include <stdint.h>