Add legacy inlines for locale aware APIs.
Test: make checkbuild tests
Bug: http://b/31639993
Change-Id: Ic43d690dff3c6960d7826bd0b064640a3ea0e883
diff --git a/libc/include/android/legacy_string_inlines.h b/libc/include/android/legacy_string_inlines.h
new file mode 100644
index 0000000..6b711d7
--- /dev/null
+++ b/libc/include/android/legacy_string_inlines.h
@@ -0,0 +1,41 @@
+/*
+ * 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 int strcoll_l(const char* _Nonnull s1, const char* _Nonnull s2,
+ locale_t l __unused) __purefunc {
+ 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 */