Stop using the __ANDROID_API_x__ constants.

Historically we've made a few mistakes where they haven't matched the
right number. And most non-Googlers are much more familiar with the
numbers, so it seems to make sense to rely more on them. Especially in
header files, which we actually expect real people to have to read from
time to time.

Test: treehugger
Change-Id: I0d4a97454ee108de1d32f21df285315c5488d886
diff --git a/libc/include/sys/epoll.h b/libc/include/sys/epoll.h
index a213a90..3745737 100644
--- a/libc/include/sys/epoll.h
+++ b/libc/include/sys/epoll.h
@@ -51,7 +51,7 @@
  * https://github.com/android-ndk/ndk/issues/302
  * https://github.com/android-ndk/ndk/issues/394
  */
-#if __ANDROID_API__ < __ANDROID_API_L__ && defined(EPOLL_CLOEXEC)
+#if __ANDROID_API__ < 21 && defined(EPOLL_CLOEXEC)
 #undef EPOLL_CLOEXEC
 #endif
 
diff --git a/libc/include/sys/inotify.h b/libc/include/sys/inotify.h
index 32e16d9..37fbf99 100644
--- a/libc/include/sys/inotify.h
+++ b/libc/include/sys/inotify.h
@@ -48,7 +48,7 @@
  *
  * https://github.com/android-ndk/ndk/issues/394
  */
-#if __ANDROID_API__ >= __ANDROID_API_L__
+#if __ANDROID_API__ >= 21
 #define IN_CLOEXEC O_CLOEXEC
 #define IN_NONBLOCK O_NONBLOCK
 #endif
diff --git a/libc/include/sys/mman.h b/libc/include/sys/mman.h
index 3b83229..fe4ea7f 100644
--- a/libc/include/sys/mman.h
+++ b/libc/include/sys/mman.h
@@ -54,7 +54,7 @@
 void* mmap(void* __addr, size_t __size, int __prot, int __flags, int __fd, off_t __offset);
 #endif
 
-#if __ANDROID_API__ >= __ANDROID_API_L__
+#if __ANDROID_API__ >= 21
 /**
  * mmap64() is a variant of mmap() that takes a 64-bit offset even on LP32.
  *
@@ -173,7 +173,7 @@
 
 #endif
 
-#if __ANDROID_API__ >= __ANDROID_API_M__
+#if __ANDROID_API__ >= 23
 
 /*
  * Some third-party code uses the existence of POSIX_MADV_NORMAL to detect the
diff --git a/libc/include/sys/select.h b/libc/include/sys/select.h
index 1ee8d2a..79fc28d 100644
--- a/libc/include/sys/select.h
+++ b/libc/include/sys/select.h
@@ -79,7 +79,7 @@
 #define __FD_SET(fd, set) (__FDS_BITS(fd_set*,set)[__FDELT(fd)] |= __FDMASK(fd))
 #define __FD_ISSET(fd, set) ((__FDS_BITS(const fd_set*,set)[__FDELT(fd)] & __FDMASK(fd)) != 0)
 
-#if __ANDROID_API__ >= __ANDROID_API_L__
+#if __ANDROID_API__ >= 21
 
 /** Removes `fd` from the given set. Use <poll.h> instead. */
 #define FD_CLR(fd, set) __FD_CLR_chk(fd, set, __bos(set))
diff --git a/libc/include/sys/socket.h b/libc/include/sys/socket.h
index e54dd65..e2acab7 100644
--- a/libc/include/sys/socket.h
+++ b/libc/include/sys/socket.h
@@ -112,7 +112,7 @@
    ? (struct cmsghdr*) (msg)->msg_control : (struct cmsghdr*) NULL)
 #define CMSG_OK(mhdr, cmsg) ((cmsg)->cmsg_len >= sizeof(struct cmsghdr) &&   (cmsg)->cmsg_len <= (unsigned long)   ((mhdr)->msg_controllen -   ((char*)(cmsg) - (char*)(mhdr)->msg_control)))
 
-#if __ANDROID_API__ >= __ANDROID_API_L__
+#if __ANDROID_API__ >= 21
 struct cmsghdr* __cmsg_nxthdr(struct msghdr* __msg, struct cmsghdr* __cmsg) __INTRODUCED_IN(21);
 #else
 /* TODO(danalbert): Move this into libandroid_support. */
@@ -127,7 +127,7 @@
   }
   return ptr;
 }
-#endif /* __ANDROID_API__ >= __ANDROID_API_L__ */
+#endif
 
 #define SCM_RIGHTS 0x01
 #define SCM_CREDENTIALS 0x02
diff --git a/libc/include/sys/stat.h b/libc/include/sys/stat.h
index 79113b6..d8e92d9 100644
--- a/libc/include/sys/stat.h
+++ b/libc/include/sys/stat.h
@@ -171,7 +171,7 @@
 #include <bits/fortify/stat.h>
 #endif
 
-#if __ANDROID_API__ >= __ANDROID_API_L__
+#if __ANDROID_API__ >= 21
 int mkfifo(const char* __path, mode_t __mode) __INTRODUCED_IN(21);
 #else
 // Implemented as a static inline before 21.
diff --git a/libc/include/sys/wait.h b/libc/include/sys/wait.h
index 106946b..8c0655f 100644
--- a/libc/include/sys/wait.h
+++ b/libc/include/sys/wait.h
@@ -40,7 +40,7 @@
 
 pid_t wait(int* __status);
 pid_t waitpid(pid_t __pid, int* __status, int __options);
-#if __ANDROID_API__ >= __ANDROID_API_J_MR2__
+#if __ANDROID_API__ >= 18
 pid_t wait4(pid_t __pid, int* __status, int __options, struct rusage* __rusage) __INTRODUCED_IN(18);
 #else
 // Implemented as a static inline before 18.