From 742f553b18194b82c78f1a96b57cc34958b53ce7 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Sun, 7 Oct 2018 09:29:17 -0700 Subject: libcutils isn't in the NDK. Bug: https://github.com/landley/toybox/issues/43 --- lib/portability.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/portability.h b/lib/portability.h index d20e4099..1f5fbf6f 100644 --- a/lib/portability.h +++ b/lib/portability.h @@ -244,7 +244,6 @@ pid_t xfork(void); // use toybox before they're ready to switch to host bionic. #ifdef __BIONIC__ #include -#include #include #else typedef enum android_LogPriority { @@ -262,8 +261,6 @@ static inline int __android_log_write(int pri, const char *tag, const char *msg) { return -1; } -static inline int get_sched_policy(int tid, void *policy) {return 0;} -static inline char *get_sched_policy_name(int policy) {return "unknown";} #define PROP_VALUE_MAX 92 static inline int __system_property_set(const char *key, const char *value) { @@ -271,6 +268,15 @@ static inline int __system_property_set(const char *key, const char *value) } #endif +#if defined(__BIONIC__) +#if defined(__ANDROID_NDK__) +static inline int get_sched_policy(int tid, void *policy) {return 0;} +static inline char *get_sched_policy_name(int policy) {return "unknown";} +#else +#include +#endif +#endif + #ifndef SYSLOG_NAMES typedef struct {char *c_name; int c_val;} CODE; extern CODE prioritynames[], facilitynames[]; -- cgit v1.2.3