From 5619f854f9f6d60d9bb8f361fe0d8e111ea6c92f Mon Sep 17 00:00:00 2001 From: Lukasz Rymanowski Date: Wed, 23 Oct 2013 14:49:19 +0200 Subject: [PATCH] android: Fix build error for Android Android uses functions and defines from sys/capability.h which requires additional include. However file capability.h shows up in bionic in version Android 4.3, therefore we do check PLATFORM_SDK_VERSION to no break builds of previous Android versions. In previous Android version unistd.h contain this functionality. --- android/Android.mk | 3 ++- android/main.c | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/android/Android.mk b/android/Android.mk index 542c8f461..dd9c36d5d 100644 --- a/android/Android.mk +++ b/android/Android.mk @@ -38,7 +38,8 @@ LOCAL_C_INCLUDES += \ $(LOCAL_PATH)/../src \ $(LOCAL_PATH)/../lib \ -LOCAL_CFLAGS := -DVERSION=\"$(BLUEZ_VERSION)\" +LOCAL_CFLAGS := -DVERSION=\"$(BLUEZ_VERSION)\" \ + -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION) LOCAL_SHARED_LIBRARIES := \ libglib \ diff --git a/android/main.c b/android/main.c index 57b9bba44..1721df8b9 100644 --- a/android/main.c +++ b/android/main.c @@ -54,6 +54,12 @@ #include "hal-msg.h" #include "ipc.h" +/* TODO: Consider to remove PLATFORM_SDKVERSION check if requirement +* for minimal Android platform version increases. */ +#if defined(ANDROID) && PLATFORM_SDK_VERSION >= 18 +#include +#endif + static GMainLoop *event_loop; static struct mgmt *mgmt_if = NULL; -- 2.11.0