Mark abs/labs/llabs as 19+ rather than 21+

The libc.map.txt file already defines these three functions as having
been introduced in API 19, but these header files had declared them as
21 and up.

See https://android-review.googlesource.com/c/platform/development/+/233407

imaxabs is already declared as 19 and up.

Test: build-ndk-prebuilts.sh && ./update_platform.py &&
  checkbuild.py && run_tests.py
Test: manually build app against 18 and 19

Change-Id: Iaeed48d7e6c438d816635a0433a056e557e8ebc2
diff --git a/libc/include/android/legacy_stdlib_inlines.h b/libc/include/android/legacy_stdlib_inlines.h
index e26e5f2..a1cc590 100644
--- a/libc/include/android/legacy_stdlib_inlines.h
+++ b/libc/include/android/legacy_stdlib_inlines.h
@@ -34,6 +34,22 @@
 #include <stdlib.h>
 #include <sys/cdefs.h>
 
+#if __ANDROID_API__ < __ANDROID_API_K__
+
+__BEGIN_DECLS
+
+static __inline int abs(int __n) { return (__n < 0) ? -__n : __n; }
+
+static __inline long labs(long __n) { return (__n < 0L) ? -__n : __n; }
+
+static __inline long long llabs(long long __n) {
+  return (__n < 0LL) ? -__n : __n;
+}
+
+__END_DECLS
+
+#endif
+
 #if __ANDROID_API__ < __ANDROID_API_L__
 
 __BEGIN_DECLS
@@ -52,14 +68,6 @@
 
 static __inline double atof(const char *nptr) { return (strtod(nptr, NULL)); }
 
-static __inline int abs(int __n) { return (__n < 0) ? -__n : __n; }
-
-static __inline long labs(long __n) { return (__n < 0L) ? -__n : __n; }
-
-static __inline long long llabs(long long __n) {
-  return (__n < 0LL) ? -__n : __n;
-}
-
 static __inline int rand(void) { return (int)lrand48(); }
 
 static __inline void srand(unsigned int __s) { srand48(__s); }
diff --git a/libc/include/stdlib.h b/libc/include/stdlib.h
index 1ae3c6e..944d72b 100644
--- a/libc/include/stdlib.h
+++ b/libc/include/stdlib.h
@@ -172,12 +172,17 @@
 #include <bits/fortify/stdlib.h>
 #endif
 
+#if __ANDROID_API__ >= __ANDROID_API_K__
+int abs(int __x) __attribute_const__ __INTRODUCED_IN(19);
+long labs(long __x) __attribute_const__ __INTRODUCED_IN(19);
+long long llabs(long long __x) __attribute_const__ __INTRODUCED_IN(19);
+#else
+// Implemented as static inlines before 19.
+#endif
+
 #if __ANDROID_API__ >= __ANDROID_API_L__
 float strtof(const char* __s, char** __end_ptr) __INTRODUCED_IN(21);
 double atof(const char* __s) __attribute_pure__ __INTRODUCED_IN(21);
-int abs(int __x) __attribute_const__ __INTRODUCED_IN(21);
-long labs(long __x) __attribute_const__ __INTRODUCED_IN(21);
-long long llabs(long long __x) __attribute_const__ __INTRODUCED_IN(21);
 int rand(void) __INTRODUCED_IN(21);
 void srand(unsigned int __seed) __INTRODUCED_IN(21);
 long random(void) __INTRODUCED_IN(21);