async-safe logging: __ANDROID_API_LEVEL__ isn't a thing.
__ANDROID_API__ is the actual name for this.
Change-Id: I6a8e68ec9e642b0328396914efa3e1f57dc7426d
diff --git a/libc/async_safe/async_safe_log.cpp b/libc/async_safe/async_safe_log.cpp
index 07133b7..c24b326 100644
--- a/libc/async_safe/async_safe_log.cpp
+++ b/libc/async_safe/async_safe_log.cpp
@@ -359,7 +359,7 @@
buffer[1] = 'x';
format_integer(buffer + 2, sizeof(buffer) - 2, value, 'x');
} else if (c == 'm') {
-#if __ANDROID_API_LEVEL__ >= 35 // This library is used in mainline modules.
+#if __ANDROID_API__ >= 35 // This library is used in mainline modules.
if (alternate) {
const char* name = strerrorname_np(errno);
if (name) {
diff --git a/tests/async_safe_test.cpp b/tests/async_safe_test.cpp
index ffb8651..8692c8a 100644
--- a/tests/async_safe_test.cpp
+++ b/tests/async_safe_test.cpp
@@ -79,13 +79,13 @@
async_safe_format_buffer(buf, sizeof(buf), "a%mZ");
EXPECT_STREQ("aInvalid argumentZ", buf);
-#if __ANDROID_API_LEVEL__ >= 35
+#if __ANDROID_API__ >= 35
errno = EINVAL;
async_safe_format_buffer(buf, sizeof(buf), "a%#mZ");
EXPECT_STREQ("aEINVALZ", buf);
#endif
-#if __ANDROID_API_LEVEL__ >= 35
+#if __ANDROID_API__ >= 35
errno = -1;
async_safe_format_buffer(buf, sizeof(buf), "a%#mZ");
EXPECT_STREQ("a-1Z", buf);