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/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);