Make the legacy inline headers compile standalone.
It's useful to have the legacy inlines compile by themselves, both to
make header unification easier, and to ensure that the inline versions
match the regular declarations. Notably, this wasn't true for
sigismember, which took a const sigset_t* in the regular header, and
sigset_t* in the inline version.
Bug: http://b/28178111
Change-Id: Id8a3b7dcb1bfa61eed93c9fb50d3192744f8bef5
diff --git a/libc/include/sys/cdefs.h b/libc/include/sys/cdefs.h
index f51942b..2bd058e 100644
--- a/libc/include/sys/cdefs.h
+++ b/libc/include/sys/cdefs.h
@@ -443,6 +443,12 @@
/* Used to rename functions so that the compiler emits a call to 'x' rather than the function this was applied to. */
#define __RENAME(x) __asm__(#x)
+#if __ANDROID_API__ < 21
+#define __BIONIC_LEGACY_INLINE static __inline
+#else
+#define __BIONIC_LEGACY_INLINE extern
+#endif
+
#ifdef __clang__
#define __AVAILABILITY(...) __attribute__((availability(android,__VA_ARGS__)))
#define __INTRODUCED_IN(api_level) __AVAILABILITY(introduced=api_level)