From c61f82baa6ebb5ebf1f2a6c18808ab17eb662e8c Mon Sep 17 00:00:00 2001 From: Luke Go Date: Wed, 29 Apr 2020 11:48:28 +0900 Subject: [PATCH] WiringPi: Android: Redefine some function that's not supported. - Some api are not supported or redefined by android libraries. So to support them on the android, this patch redefined the apis. And, some api are not allowed. So avoid including the package by the problem. Change-Id: Icaf2716a82dd98fc3c4fc3c597d4e67f3df8d755 --- Android.bp | 1 - wiringPi/wiringPi.h | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Android.bp b/Android.bp index ea4850f..41e8464 100644 --- a/Android.bp +++ b/Android.bp @@ -47,7 +47,6 @@ cc_library_shared { "wiringPi/mcp3422.c", "wiringPi/pcf8591.c", "wiringPi/softTone.c", - "wiringPi/wpiExtensions.c", ], vendor_available: true, diff --git a/wiringPi/wiringPi.h b/wiringPi/wiringPi.h index 893b692..f24b3e8 100644 --- a/wiringPi/wiringPi.h +++ b/wiringPi/wiringPi.h @@ -31,6 +31,11 @@ /*----------------------------------------------------------------------------*/ +#ifdef __ANDROID__ +#define __bswap_16(x) bswap_16(x) +#define __bswap_32(x) bswap_32(x) +#endif + #ifndef TRUE #define TRUE (1==1) #define FALSE (!TRUE)