Merge "Revert "async-safe logging: __ANDROID_API_LEVEL__ isn't a thing."" into main
diff --git a/libc/async_safe/async_safe_log.cpp b/libc/async_safe/async_safe_log.cpp
index c24b326..07133b7 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__ >= 35 // This library is used in mainline modules.
+#if __ANDROID_API_LEVEL__ >= 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 8692c8a..ffb8651 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__ >= 35
+#if __ANDROID_API_LEVEL__ >= 35
errno = EINVAL;
async_safe_format_buffer(buf, sizeof(buf), "a%#mZ");
EXPECT_STREQ("aEINVALZ", buf);
#endif
-#if __ANDROID_API__ >= 35
+#if __ANDROID_API_LEVEL__ >= 35
errno = -1;
async_safe_format_buffer(buf, sizeof(buf), "a%#mZ");
EXPECT_STREQ("a-1Z", buf);