Revert "Add legacy inlines for locale aware APIs."

We can't really add these to the unified headers yet since we're
still using the old headers as well, and libandroid_support needs to
work with both. These functions are already defined in
libandroid_support, so when using unified headers we'll get duplicate
definitions.

This was only going to be a temporary solution anyway. Instead we'll
just rely on libandroid_support (and eventually its rewrite) to handle
these.

This reverts commit 6576a3749bd3805508294bfcac3d9658fc0f8d6e.

Test: ./tools/update_headers.py && make ndk && make native
      # Copied into working directory for unified headers NDK work.
      ndk/checkbuild.py
      ndk/run_tests.py --force-unified-headers
Bug: None

Change-Id: I5762e815e2030c89d7f2540df08dd67b6c2d10a5
diff --git a/libc/include/android/legacy_ctype_inlines.h b/libc/include/android/legacy_ctype_inlines.h
deleted file mode 100644
index ca01e3f..0000000
--- a/libc/include/android/legacy_ctype_inlines.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_LEGACY_CTYPE_INLINES_H
-#define ANDROID_LEGACY_CTYPE_INLINES_H
-
-#include <ctype.h>
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-
-#if __ANDROID_API__ < 21
-
-static __inline int isalnum_l(int c, locale_t l __unused) {
-  return isalnum(c);
-}
-
-static __inline int isalpha_l(int c, locale_t l __unused) {
-  return isalpha(c);
-}
-
-static __inline int isblank_l(int c, locale_t l __unused) {
-  return isblank(c);
-}
-
-static __inline int iscntrl_l(int c, locale_t l __unused) {
-  return iscntrl(c);
-}
-
-static __inline int isdigit_l(int c, locale_t l __unused) {
-  return isdigit(c);
-}
-
-static __inline int isgraph_l(int c, locale_t l __unused) {
-  return isgraph(c);
-}
-
-static __inline int islower_l(int c, locale_t l __unused) {
-  return islower(c);
-}
-
-static __inline int isprint_l(int c, locale_t l __unused) {
-  return isprint(c);
-}
-
-static __inline int ispunct_l(int c, locale_t l __unused) {
-  return ispunct(c);
-}
-
-static __inline int isspace_l(int c, locale_t l __unused) {
-  return isspace(c);
-}
-
-static __inline int isupper_l(int c, locale_t l __unused) {
-  return isupper(c);
-}
-
-static __inline int isxdigit_l(int c, locale_t l __unused) {
-  return isxdigit(c);
-}
-
-static __inline int tolower_l(int c, locale_t l __unused) {
-  return tolower(c);
-}
-
-static __inline int toupper_l(int c, locale_t l __unused) {
-  return toupper(c);
-}
-
-#endif /* __ANDROID_API__ < 21 */
-
-__END_DECLS
-
-#endif /* ANDROID_LEGACY_CTYPE_INLINES_H */
diff --git a/libc/include/android/legacy_stdlib_inlines.h b/libc/include/android/legacy_stdlib_inlines.h
index 77fdd5d..93554e5 100644
--- a/libc/include/android/legacy_stdlib_inlines.h
+++ b/libc/include/android/legacy_stdlib_inlines.h
@@ -32,10 +32,10 @@
 #include <stdlib.h>
 #include <sys/cdefs.h>
 
-__BEGIN_DECLS
-
 #if __ANDROID_API__ < 21
 
+__BEGIN_DECLS
+
 static __inline float strtof(const char *nptr, char **endptr) {
   return (float)strtod(nptr, endptr);
 }
@@ -62,32 +62,7 @@
   return 0; /* devpts does this all for us! */
 }
 
-static __inline long double strtold_l(const char* nptr, char** endptr, locale_t l __unused) {
-  return strtold(nptr, endptr);
-}
-
-static __inline long long strtoll_l(const char* nptr, char** endptr, int base, locale_t l __unused) {
-  return strtoll(nptr, endptr, base);
-}
-
-static __inline unsigned long long strtoull_l(const char* nptr, char** endptr, int base,
-                                              locale_t l __unused) {
-  return strtoull(nptr, endptr, base);
-}
-
-#endif /* __ANDROID_API__ < 21 */
-
-#if __ANDROID_API__ < __ANDROID_API_FUTURE__
-
-static __inline float strtof_l(const char* nptr, char** endptr, locale_t l __unused) {
-  return strtof(nptr, endptr);
-}
-
-static __inline double strtod_l(const char* nptr, char** endptr, locale_t l __unused) {
-  return strtod(nptr, endptr);
-}
-
-#endif /* __ANDROID_API__ < __ANDROID_API_FUTURE__ */
-
 __END_DECLS
+
+#endif
 #endif /* _ANDROID_LEGACY_STDLIB_INLINES_H_ */
diff --git a/libc/include/android/legacy_string_inlines.h b/libc/include/android/legacy_string_inlines.h
deleted file mode 100644
index ceab909..0000000
--- a/libc/include/android/legacy_string_inlines.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_LEGACY_STRING_INLINES_H
-#define ANDROID_LEGACY_STRING_INLINES_H
-
-#include <string.h>
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-
-#if __ANDROID_API__ < 21
-
-static __inline __attribute_pure__ int strcoll_l(const char* _Nonnull s1, const char* _Nonnull s2,
-                                                 locale_t l __unused)  {
-  return strcoll(s1, s2);
-}
-
-size_t strxfrm_l(char* __restrict dest, const char* _Nonnull __restrict src, size_t n,
-                 locale_t l __unused) {
-  return strxfrm(dest, src, n);
-}
-
-#endif /* __ANDROID_API__ < 21 */
-
-__END_DECLS
-
-#endif /* ANDROID_LEGACY_STRING_INLINES_H */
diff --git a/libc/include/android/legacy_time_inlines.h b/libc/include/android/legacy_time_inlines.h
deleted file mode 100644
index 319cc7c..0000000
--- a/libc/include/android/legacy_time_inlines.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_LEGACY_TIME_INLINES_H
-#define ANDROID_LEGACY_TIME_INLINES_H
-
-#include <sys/cdefs.h>
-#include <time.h>
-
-__BEGIN_DECLS
-
-#if __ANDROID_API__ < 21
-
-static __inline int strftime_l(char* s, size_t max, const char* format, const struct tm* tm,
-                               locale_t l __unused) {
-  return strftime(s, max, format, tm);
-}
-
-#endif /* __ANDROID_API__ < 21 */
-
-__END_DECLS
-
-#endif /* ANDROID_LEGACY_TIME_INLINES_H */
diff --git a/libc/include/android/legacy_wchar_inlines.h b/libc/include/android/legacy_wchar_inlines.h
deleted file mode 100644
index 6c0d29e..0000000
--- a/libc/include/android/legacy_wchar_inlines.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_LEGACY_WCHAR_INLINES_H
-#define ANDROID_LEGACY_WCHAR_INLINES_H
-
-#include <sys/cdefs.h>
-#include <wchar.h>
-
-__BEGIN_DECLS
-
-#if __ANDROID_API__ < 21
-
-static __inline int wcscoll_l(const wchar_t* _Nonnull ws1, const wchar_t* _Nonnull ws2,
-                              locale_t l __unused) {
-  return wcscoll(ws1, ws2);
-}
-
-size_t wcsxfrm_l(wchar_t* dest, const wchar_t* _Nonnull src, size_t n, locale_t l __unused) {
-  return wcsxfrm(dest, src, n);
-}
-
-static inline long double wcstold_l(const wchar_t* nptr, wchar_t** endptr, locale_t l __unused) {
-  return wcstold(nptr, endptr);
-}
-
-static inline long long wcstoll_l(const wchar_t* nptr, wchar_t** endptr, int base,
-                                  locale_t l __unused) {
-  return wcstoll(nptr, endptr, base);
-}
-
-static inline unsigned long long wcstoull_l(const wchar_t* nptr, wchar_t** endptr, int base,
-                                            locale_t l __unused) {
-  return wcstoull(nptr, endptr, base);
-}
-
-#endif /* __ANDROID_API__ < 21 */
-
-__END_DECLS
-
-#endif /* ANDROID_LEGACY_WCHAR_INLINES_H */
diff --git a/libc/include/android/legacy_wctype_inlines.h b/libc/include/android/legacy_wctype_inlines.h
deleted file mode 100644
index c490944..0000000
--- a/libc/include/android/legacy_wctype_inlines.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_LEGACY_WCTYPE_INLINES_H
-#define ANDROID_LEGACY_WCTYPE_INLINES_H
-
-#include <sys/cdefs.h>
-#include <wctype.h>
-
-__BEGIN_DECLS
-
-#if __ANDROID_API__ < 21
-
-static __inline int iswalnum_l(wint_t wc, locale_t l __unused) {
-  return iswalnum(wc);
-}
-
-static __inline int iswalpha_l(wint_t wc, locale_t l __unused) {
-  return iswalpha(wc);
-}
-
-static __inline int iswblank_l(wint_t wc, locale_t l __unused) {
-  return iswblank(wc);
-}
-
-static __inline int iswcntrl_l(wint_t wc, locale_t l __unused) {
-  return iswcntrl(wc);
-}
-
-static __inline int iswdigit_l(wint_t wc, locale_t l __unused) {
-  return iswdigit(wc);
-}
-
-static __inline int iswgraph_l(wint_t wc, locale_t l __unused) {
-  return iswgraph(wc);
-}
-
-static __inline int iswlower_l(wint_t wc, locale_t l __unused) {
-  return iswlower(wc);
-}
-
-static __inline int iswprint_l(wint_t wc, locale_t l __unused) {
-  return iswprint(wc);
-}
-
-static __inline int iswpunct_l(wint_t wc, locale_t l __unused) {
-  return iswpunct(wc);
-}
-
-static __inline int iswspace_l(wint_t wc, locale_t l __unused) {
-  return iswspace(wc);
-}
-
-static __inline int iswupper_l(wint_t wc, locale_t l __unused) {
-  return iswupper(wc);
-}
-
-static __inline int iswxdigit_l(wint_t wc, locale_t l __unused) {
-  return iswxdigit(wc);
-}
-
-static __inline wint_t towlower_l(wint_t wc, locale_t l __unused) {
-  return towlower(wc);
-}
-
-static __inline wint_t towupper_l(wint_t wc, locale_t l __unused) {
-  return towupper(wc);
-}
-
-#endif /* __ANDROID_API__ < 21 */
-
-__END_DECLS
-
-#endif /* ANDROID_LEGACY_WCTYPE_INLINES_H */
diff --git a/libc/include/ctype.h b/libc/include/ctype.h
index e1b237a..f59b399 100644
--- a/libc/include/ctype.h
+++ b/libc/include/ctype.h
@@ -102,6 +102,4 @@
 
 __END_DECLS
 
-#include <android/legacy_ctype_inlines.h>
-
 #endif /* !_CTYPE_H_ */
diff --git a/libc/include/string.h b/libc/include/string.h
index 0114e6a..b3b3ed0 100644
--- a/libc/include/string.h
+++ b/libc/include/string.h
@@ -391,6 +391,4 @@
 
 __END_DECLS
 
-#include <android/legacy_string_inlines.h>
-
 #endif /* _STRING_H */
diff --git a/libc/include/time.h b/libc/include/time.h
index 898b816..37246b4 100644
--- a/libc/include/time.h
+++ b/libc/include/time.h
@@ -109,6 +109,4 @@
 
 __END_DECLS
 
-#include <android/legacy_time_inlines.h>
-
 #endif /* _TIME_H_ */
diff --git a/libc/include/wchar.h b/libc/include/wchar.h
index c3ad91c..2ee6c69 100644
--- a/libc/include/wchar.h
+++ b/libc/include/wchar.h
@@ -153,6 +153,4 @@
 
 __END_DECLS
 
-#include <android/legacy_wchar_inlines.h>
-
 #endif /* _WCHAR_H_ */
diff --git a/libc/include/wctype.h b/libc/include/wctype.h
index a77b212..0613e7e 100644
--- a/libc/include/wctype.h
+++ b/libc/include/wctype.h
@@ -63,6 +63,4 @@
 
 __END_DECLS
 
-#include <android/legacy_wctype_inlines.h>
-
 #endif /* _WCTYPE_H_ */