From 25c3e691140f48e971bdcc558cdf9acb7576598a Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Wed, 13 Nov 2019 08:48:44 -0600 Subject: Old gcc versions are confused by __has_include(), so nest the #ifdefs and #define/#undef a second symbol for the else case. --- lib/portability.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/portability.h b/lib/portability.h index 896fba34..b586c132 100644 --- a/lib/portability.h +++ b/lib/portability.h @@ -287,8 +287,14 @@ static inline int __android_log_write(int pri, const char *tag, const char *msg) #endif // libprocessgroup is an Android platform library not included in the NDK. -#if defined(__BIONIC__) && __has_include() +#if defined(__BIONIC__) +#if __has_include() #include +#define GOT_IT +#endif +#endif +#ifdef GOT_IT +#undef GOT_IT #else static inline int get_sched_policy(int tid, void *policy) {return 0;} static inline char *get_sched_policy_name(int policy) {return "unknown";} -- cgit v1.2.3