aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/portability.h8
1 files changed, 7 insertions, 1 deletions
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(<processgroup/sched_policy.h>)
+#if defined(__BIONIC__)
+#if __has_include(<processgroup/sched_policy.h>)
#include <processgroup/sched_policy.h>
+#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";}