From f945fb6b8a09d08be89b1b771b20d7291baab659 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Tue, 17 Oct 2017 11:07:26 -0700 Subject: [PATCH] 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 --- libc/include/android/legacy_errno_inlines.h | 3 ++- libc/include/android/legacy_fenv_inlines_arm.h | 4 +++- libc/include/android/legacy_fenv_inlines_mips.h | 4 +++- libc/include/android/legacy_signal_inlines.h | 12 ++++++------ libc/include/android/legacy_stdlib_inlines.h | 7 ++++--- libc/include/android/legacy_strings_inlines.h | 9 ++++++--- libc/include/android/legacy_sys_mman_inlines.h | 7 ++++--- libc/include/android/legacy_sys_stat_inlines.h | 3 ++- libc/include/android/legacy_sys_wait_inlines.h | 5 +++-- libc/include/android/legacy_termios_inlines.h | 8 +++++--- 10 files changed, 38 insertions(+), 24 deletions(-) diff --git a/libc/include/android/legacy_errno_inlines.h b/libc/include/android/legacy_errno_inlines.h index 8f08074f1..9f116faea 100644 --- a/libc/include/android/legacy_errno_inlines.h +++ b/libc/include/android/legacy_errno_inlines.h @@ -29,11 +29,12 @@ #ifndef _ANDROID_LEGACY_ERRNO_INLINES_H #define _ANDROID_LEGACY_ERRNO_INLINES_H -#include #include #if __ANDROID_API__ < __ANDROID_API_L__ +#include + __BEGIN_DECLS static __inline int __attribute__((deprecated)) __set_errno(int n) { diff --git a/libc/include/android/legacy_fenv_inlines_arm.h b/libc/include/android/legacy_fenv_inlines_arm.h index 58c49c2cf..f5b2828e1 100644 --- a/libc/include/android/legacy_fenv_inlines_arm.h +++ b/libc/include/android/legacy_fenv_inlines_arm.h @@ -29,10 +29,12 @@ #ifndef ANDROID_LEGACY_FENV_INLINES_ARM_H #define ANDROID_LEGACY_FENV_INLINES_ARM_H -#include +#include #if __ANDROID_API__ < __ANDROID_API_L__ && defined(__arm__) +#include + __BEGIN_DECLS #define FPSCR_ENABLE_SHIFT 8 diff --git a/libc/include/android/legacy_fenv_inlines_mips.h b/libc/include/android/legacy_fenv_inlines_mips.h index 10b93c070..43ad360d1 100644 --- a/libc/include/android/legacy_fenv_inlines_mips.h +++ b/libc/include/android/legacy_fenv_inlines_mips.h @@ -29,10 +29,12 @@ #ifndef ANDROID_LEGACY_FENV_INLINES_MIPS_H #define ANDROID_LEGACY_FENV_INLINES_MIPS_H -#include +#include #if __ANDROID_API__ < __ANDROID_API_L__ && (defined(__mips__) && !defined(__LP64__)) +#include + __BEGIN_DECLS #define FCSR_CAUSE_SHIFT 10 diff --git a/libc/include/android/legacy_signal_inlines.h b/libc/include/android/legacy_signal_inlines.h index 4d474b093..44c2f4f63 100644 --- a/libc/include/android/legacy_signal_inlines.h +++ b/libc/include/android/legacy_signal_inlines.h @@ -29,16 +29,16 @@ #ifndef _ANDROID_LEGACY_SIGNAL_INLINES_H_ #define _ANDROID_LEGACY_SIGNAL_INLINES_H_ +#include + +#if __ANDROID_API__ < __ANDROID_API_L__ + #include #include #include -#include - __BEGIN_DECLS -#if __ANDROID_API__ < __ANDROID_API_L__ - sighandler_t bsd_signal(int __signal, sighandler_t __handler) __REMOVED_IN(21); /* These weren't introduced until L. */ @@ -117,8 +117,8 @@ static __inline sighandler_t signal(int s, sighandler_t f) { return bsd_signal(s, f); } -#endif /* __ANDROID_API__ < __ANDROID_API_L__ */ - __END_DECLS +#endif /* __ANDROID_API__ < __ANDROID_API_L__ */ + #endif /* _ANDROID_LEGACY_SIGNAL_INLINES_H_ */ diff --git a/libc/include/android/legacy_stdlib_inlines.h b/libc/include/android/legacy_stdlib_inlines.h index e26e5f22a..34a968c86 100644 --- a/libc/include/android/legacy_stdlib_inlines.h +++ b/libc/include/android/legacy_stdlib_inlines.h @@ -29,13 +29,14 @@ #ifndef _ANDROID_LEGACY_STDLIB_INLINES_H_ #define _ANDROID_LEGACY_STDLIB_INLINES_H_ -#include -#include -#include #include #if __ANDROID_API__ < __ANDROID_API_L__ +#include +#include +#include + __BEGIN_DECLS static __inline float strtof(const char* nptr, char** endptr) { diff --git a/libc/include/android/legacy_strings_inlines.h b/libc/include/android/legacy_strings_inlines.h index 6679c3047..5d63c5a31 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 #include +#if defined(__i386__) && __ANDROID_API__ < __ANDROID_API_J_MR2__ + +#include + __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 diff --git a/libc/include/android/legacy_sys_mman_inlines.h b/libc/include/android/legacy_sys_mman_inlines.h index 7eb537e7e..160e6fe60 100644 --- a/libc/include/android/legacy_sys_mman_inlines.h +++ b/libc/include/android/legacy_sys_mman_inlines.h @@ -29,12 +29,13 @@ #pragma once #include -#include -#include -#include #if __ANDROID_API__ < __ANDROID_API_L__ +#include +#include +#include + __BEGIN_DECLS /* diff --git a/libc/include/android/legacy_sys_stat_inlines.h b/libc/include/android/legacy_sys_stat_inlines.h index bbf54c064..95216942b 100644 --- a/libc/include/android/legacy_sys_stat_inlines.h +++ b/libc/include/android/legacy_sys_stat_inlines.h @@ -30,10 +30,11 @@ #define _ANDROID_LEGACY_SYS_STAT_INLINES_H_ #include -#include #if __ANDROID_API__ < __ANDROID_API_L__ +#include + __BEGIN_DECLS static __inline int mkfifo(const char* __path, mode_t __mode) { diff --git a/libc/include/android/legacy_sys_wait_inlines.h b/libc/include/android/legacy_sys_wait_inlines.h index 1124f8e29..4298d767b 100644 --- a/libc/include/android/legacy_sys_wait_inlines.h +++ b/libc/include/android/legacy_sys_wait_inlines.h @@ -30,12 +30,13 @@ #define _ANDROID_LEGACY_SYS_WAIT_INLINES_H_ #include + +#if __ANDROID_API__ < __ANDROID_API_J_MR2__ + #include #include #include -#if __ANDROID_API__ < __ANDROID_API_J_MR2__ - __BEGIN_DECLS static __inline pid_t wait4(pid_t pid, int* status, int options, struct rusage* rusage) { diff --git a/libc/include/android/legacy_termios_inlines.h b/libc/include/android/legacy_termios_inlines.h index 4ed56f049..a63dba194 100644 --- a/libc/include/android/legacy_termios_inlines.h +++ b/libc/include/android/legacy_termios_inlines.h @@ -30,14 +30,16 @@ #define _ANDROID_LEGACY_TERMIOS_INLINES_H_ #include + +#if __ANDROID_API__ < __ANDROID_API_L__ + +#include #include #include -#include - -#if __ANDROID_API__ < __ANDROID_API_L__ #define __BIONIC_TERMIOS_INLINE static __inline #include + #endif #endif /* _ANDROID_LEGACY_TERMIOS_INLINES_H_ */