Android: fix build issues with Android Marshmallow 3.40 ipc-3.40-next
authorVishal Mahaveer <vishalm@ti.com>
Fri, 20 Nov 2015 19:43:09 +0000 (13:43 -0600)
committerAngela Stegmaier <angelabaker@ti.com>
Fri, 20 Nov 2015 19:46:42 +0000 (13:46 -0600)
pthread definitions are updated in Android M, update definitions
accordingly. Using PLATFORM_SDK_VERSION to determine versions < Android M

Android version numbers can be found here:
https://source.android.com/source/build-numbers.html#platform-code-names-versions-api-levels-and-ndk-releases

Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
Android.mk
linux/src/api/Ipc.c
linux/src/api/MessageQ.c
linux/src/daemon/MessageQ_daemon.c
linux/src/daemon/NameServer_daemon.c
linux/src/utils/LAD_client.c

index 3a44921fd454e258830bc0c097e490c70617db08..554173b043c6a78992b9c6de70740f74c2aa2390 100644 (file)
@@ -39,6 +39,7 @@ LOCAL_C_INCLUDES +=  $(LOCAL_PATH)/linux/include \
                      $(LOCAL_PATH)/hlos_common/include
 
 LOCAL_CFLAGS += -DIPC_BUILDOS_ANDROID -DGATEMP_SUPPORT -fPIC
+LOCAL_CFLAGS += -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION)
 LOCAL_MODULE_TAGS:= optional
 
 LOCAL_SRC_FILES:= linux/src/api/MultiProc.c \
@@ -65,6 +66,7 @@ LOCAL_C_INCLUDES +=  $(LOCAL_PATH)/linux/include \
                      $(LOCAL_PATH)/hlos_common/include
 
 LOCAL_CFLAGS += -DIPC_BUILDOS_ANDROID
+LOCAL_CFLAGS += -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION)
 LOCAL_MODULE_TAGS:= optional
 
 LOCAL_SRC_FILES:= linux/src/utils/LAD_client.c \
@@ -87,6 +89,7 @@ LOCAL_C_INCLUDES +=  $(LOCAL_PATH)/linux/include \
                      $(LOCAL_PATH)/hlos_common/include
 
 LOCAL_CFLAGS += -DIPC_BUILDOS_ANDROID
+LOCAL_CFLAGS += -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION)
 LOCAL_MODULE_TAGS:= optional
 
 LOCAL_SRC_FILES:= linux/src/utils/LAD_client.c \
@@ -110,6 +113,7 @@ LOCAL_C_INCLUDES +=  $(LOCAL_PATH)/linux/include \
                      $(LOCAL_PATH)/hlos_common/include
 
 LOCAL_CFLAGS += -DIPC_BUILDOS_ANDROID
+LOCAL_CFLAGS += -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION)
 LOCAL_MODULE_TAGS:= optional
 
 LOCAL_SRC_FILES:= linux/src/transport/TransportRpmsg.c
@@ -128,6 +132,7 @@ LOCAL_C_INCLUDES += $(LOCAL_PATH) \
                     $(LOCAL_PATH)/packages
 
 LOCAL_CFLAGS += -DIPC_BUILDOS_ANDROID
+LOCAL_CFLAGS += -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION)
 LOCAL_MODULE_TAGS:= optional
 
 LOCAL_SRC_FILES:= packages/ti/ipc/mm/MmRpc.c
@@ -147,6 +152,7 @@ LOCAL_C_INCLUDES +=  $(LOCAL_PATH)/linux/include \
                      $(LOCAL_PATH)/hlos_common/include
 
 LOCAL_CFLAGS += -DIPC_BUILDOS_ANDROID -DGATEMP_SUPPORT
+LOCAL_CFLAGS += -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION)
 LOCAL_MODULE_TAGS:= optional
 
 LOCAL_SRC_FILES:= linux/src/daemon/lad.c \
index 44b4816a6e981c839977d5253aaae27eb6c0a6d9..509d9a89e70090ec2f51f5bebc3729894d11a877 100644 (file)
@@ -83,7 +83,7 @@ Void MessageQ_unbind(UInt16 procId);
  */
 static Ipc_Module Ipc_module = {
     .refCount           = 0,
-#if defined(IPC_BUILDOS_ANDROID)
+#if defined(IPC_BUILDOS_ANDROID) && (PLATFORM_SDK_VERSION < 23)
     .gate               = PTHREAD_RECURSIVE_MUTEX_INITIALIZER,
 #else
 // only _NP (non-portable) type available in CG tools which we're using
index f82728dcb02ead73a15287ecf2c85b17fe748921..2474e6fdd1b5169ff3bca411da1dc0c7e2c173ba 100644 (file)
@@ -156,7 +156,7 @@ static MessageQ_ModuleObject MessageQ_state =
 {
     .refCount   = 0,
     .nameServer = NULL,
-#if defined(IPC_BUILDOS_ANDROID)
+#if defined(IPC_BUILDOS_ANDROID) && (PLATFORM_SDK_VERSION < 23)
     .gate       = PTHREAD_RECURSIVE_MUTEX_INITIALIZER,
 #else
     .gate       = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
index 15d6e7640ca8b215fb50d55383d31ed175717e5f..280aa8a803f38d6f203448bfee42c8ac0627c7a5 100644 (file)
@@ -143,7 +143,7 @@ static MessageQ_ModuleObject MessageQ_state =
     .queues                 = NULL,
     .numQueues              = 2u,
     .canFreeQueues          = FALSE,
-#if defined(IPC_BUILDOS_ANDROID)
+#if defined(IPC_BUILDOS_ANDROID) && (PLATFORM_SDK_VERSION < 23)
     .gate                   = PTHREAD_RECURSIVE_MUTEX_INITIALIZER,
 #else
     .gate                   = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
index 279bf3604b4c20d0b7cfefe492cd6397f98a047c..e2961762be1d26baccd38263a3d143a6e774fb72 100644 (file)
@@ -172,7 +172,7 @@ static NameServer_ModuleObject NameServer_state = {
     .defInstParams.checkExisting     = TRUE,
     .defInstParams.maxValueLen       = 0u,
     .defInstParams.maxNameLen        = 16u,
-#if defined(IPC_BUILDOS_ANDROID)
+#if defined(IPC_BUILDOS_ANDROID) && (PLATFORM_SDK_VERSION < 23)
     .modGate                         = PTHREAD_RECURSIVE_MUTEX_INITIALIZER,
 #else
 // only _NP (non-portable) type available in CG tools which we're using
index a5c7e4c871c4b8fd10ef1e73d889a130ba84f54a..3aafb67eb870b6925e60688ae4f0b968fd58f686 100644 (file)
@@ -68,7 +68,7 @@ static _LAD_ClientInfo clientInfo[LAD_MAXNUMCLIENTS];
 static LAD_Status initWrappers(Void);
 static Bool openCommandFIFO(Void);
 
-#if defined(IPC_BUILDOS_ANDROID)
+#if defined(IPC_BUILDOS_ANDROID) && (PLATFORM_SDK_VERSION < 23)
 static pthread_mutex_t modGate  = PTHREAD_RECURSIVE_MUTEX_INITIALIZER;
 #else
 // only _NP (non-portable) type available in CG tools which we're using