Consistently use `#if defined(__BIONIC__)`.
Test: treehugger
Change-Id: I844b909404532eb9165cba1ed6f237bdd4a46990
diff --git a/tests/android_get_device_api_level.cpp b/tests/android_get_device_api_level.cpp
index 9bd6b3a..2e51022 100644
--- a/tests/android_get_device_api_level.cpp
+++ b/tests/android_get_device_api_level.cpp
@@ -28,12 +28,12 @@
#include <gtest/gtest.h>
-#if __BIONIC__
+#if __has_include(<android/api-level.h>)
#include <android/api-level.h>
#endif
TEST(android_get_device_api_level, smoke) {
-#if __BIONIC__
+#if defined(__BIONIC__)
// This will fail if you run the tests on an old device, but who does that?
ASSERT_GE(android_get_device_api_level(), 29);
#endif