Revert "Revert "Cleanup transitive includes in the legacy inlines.""
This reverts commit 9cb8639b18bc90dab461b4709607083301c9f6fc.
Fixed all the broken builds that were reported to me before this was
reverted.
Test: make checkbuild # kikey960, marlin, aosp_arm64; master and aosp
diff --git a/libc/include/android/legacy_strings_inlines.h b/libc/include/android/legacy_strings_inlines.h
index 6679c30..5d63c5a 100644
--- a/libc/include/android/legacy_strings_inlines.h
+++ b/libc/include/android/legacy_strings_inlines.h
@@ -29,16 +29,19 @@
#ifndef _ANDROID_LEGACY_STRINGS_INLINES_H_
#define _ANDROID_LEGACY_STRINGS_INLINES_H_
-#include <strings.h>
#include <sys/cdefs.h>
+#if defined(__i386__) && __ANDROID_API__ < __ANDROID_API_J_MR2__
+
+#include <strings.h>
+
__BEGIN_DECLS
-#if defined(__i386__) && __ANDROID_API__ < __ANDROID_API_J_MR2__
/* Everyone except x86 had ffs since the beginning. */
static __inline int ffs(int __n) { return __builtin_ffs(__n); }
-#endif
__END_DECLS
#endif
+
+#endif