From 78a8e8f469f32c9fa95239895dd71b02981fe7c0 Mon Sep 17 00:00:00 2001 From: Ashwini Kumar Date: Wed, 21 Sep 2016 11:03:14 +0530 Subject: [PATCH] Solve build issue https://gerrit.iotivity.org/gerrit/#/c/11331/ older g++ version support (4.6.4) Change-Id: Icd8750bd622247f9c3086560350e0c0d46ca9f28 Signed-off-by: Ashwini Kumar Reviewed-on: https://gerrit.iotivity.org/gerrit/12009 Tested-by: jenkins-iotivity Reviewed-by: Randeep Singh --- resource/provisioning/examples/SConscript | 2 +- resource/provisioning/examples/cloudClient.cpp | 38 ++++++++++++------------- resource/provisioning/examples/cloudWrapper.cpp | 4 +-- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/resource/provisioning/examples/SConscript b/resource/provisioning/examples/SConscript index 081a0a6..4dbaf3c 100644 --- a/resource/provisioning/examples/SConscript +++ b/resource/provisioning/examples/SConscript @@ -45,7 +45,7 @@ examples_env.AppendUnique(CPPPATH = [ '../../csdk/connectivity/api', '../../csdk/connectivity/inc/pkix', '../../csdk/connectivity/common/inc', - '../../csdk/connectivity/lib/libcoap-4.1.1', + '../../csdk/connectivity/lib/libcoap-4.1.1/include', '../../csdk/security/include', '../../csdk/security/include/internal', '../../csdk/security/provisioning/include', diff --git a/resource/provisioning/examples/cloudClient.cpp b/resource/provisioning/examples/cloudClient.cpp index c4b5038..bba9220 100644 --- a/resource/provisioning/examples/cloudClient.cpp +++ b/resource/provisioning/examples/cloudClient.cpp @@ -23,7 +23,7 @@ #include "ocstack.h" #include "logger.h" -#include "camutex.h" +#include "octhread.h" #include "cathreadpool.h" #include "ocpayload.h" #include "payload_logging.h" @@ -61,8 +61,8 @@ static char *fname = DEFAULT_DB_FILE; static uint64_t timeout; static uint16_t g_credId = 0; -ca_cond cond; -ca_mutex mutex; +oc_cond cond; +oc_mutex mutex; std::string ip(""); OCCloudProvisioning g_cloudProv(ip, 0); @@ -190,9 +190,9 @@ void handleCB(void* ctx, OCStackResult result, void* data) OC_UNUSED(result); OC_UNUSED(data); - ca_mutex_lock(mutex); - ca_cond_signal(cond); - ca_mutex_unlock(mutex); + oc_mutex_lock(mutex); + oc_cond_signal(cond); + oc_mutex_unlock(mutex); } void handleCB1(OCStackResult result, void *data) @@ -200,9 +200,9 @@ void handleCB1(OCStackResult result, void *data) OC_UNUSED(result); OC_UNUSED(data); - ca_mutex_lock(mutex); - ca_cond_signal(cond); - ca_mutex_unlock(mutex); + oc_mutex_lock(mutex); + oc_cond_signal(cond); + oc_mutex_unlock(mutex); } void handleCB2(OCStackResult result, std::string data) @@ -210,9 +210,9 @@ void handleCB2(OCStackResult result, std::string data) OC_UNUSED(result); OC_UNUSED(data); - ca_mutex_lock(mutex); - ca_cond_signal(cond); - ca_mutex_unlock(mutex); + oc_mutex_lock(mutex); + oc_cond_signal(cond); + oc_mutex_unlock(mutex); } static int saveTrustCert(void) @@ -267,8 +267,8 @@ static void userRequests(void *data) strncpy(endPoint.addr, DEFAULT_HOST, sizeof(endPoint.addr)); endPoint.port = DEFAULT_PORT; - mutex = ca_mutex_new(); - cond = ca_cond_new(); + mutex = oc_mutex_new(); + cond = oc_cond_new(); while (false == fExit) { @@ -400,8 +400,8 @@ static void userRequests(void *data) } break; case EXIT: - ca_mutex_free(mutex); - ca_cond_free(cond); + oc_mutex_free(mutex); + oc_cond_free(cond); fExit = true; break; default: @@ -412,9 +412,9 @@ static void userRequests(void *data) //if requests were sent then wait response if (res == OC_STACK_OK) { - ca_mutex_lock(mutex); - ca_cond_wait_for(cond, mutex, timeout); - ca_mutex_unlock(mutex); + oc_mutex_lock(mutex); + oc_cond_wait_for(cond, mutex, timeout); + oc_mutex_unlock(mutex); } } diff --git a/resource/provisioning/examples/cloudWrapper.cpp b/resource/provisioning/examples/cloudWrapper.cpp index 493ff47..49c82d2 100644 --- a/resource/provisioning/examples/cloudWrapper.cpp +++ b/resource/provisioning/examples/cloudWrapper.cpp @@ -418,10 +418,10 @@ exit: OicSecRsrc_t *res = &ace->resources[l]; OICFree(res->href); - stringArray_t rt = {.array = res->types, .length = res->typeLen}; + stringArray_t rt = {res->types, res->typeLen}; clearStringArray(&rt); - stringArray_t _if = {.array = res->interfaces, .length = res->interfaceLen}; + stringArray_t _if = {res->interfaces, res->interfaceLen}; clearStringArray(&_if); } } -- 2.7.4