Start building json2cbor for Windows.
authorDan Mihai <Daniel.Mihai@microsoft.com>
Thu, 20 Oct 2016 00:22:37 +0000 (17:22 -0700)
committerRandeep Singh <randeep.s@samsung.com>
Sat, 22 Oct 2016 09:25:20 +0000 (09:25 +0000)
Change-Id: I9a1e43969c597eed68eac0df28b90571c67de931
Signed-off-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/13521
Reviewed-by: Kevin Kane <kkane@microsoft.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: David Antler <david.a.antler@intel.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
resource/csdk/security/SConscript
resource/csdk/security/tool/SConscript
resource/csdk/security/tool/json2cbor.c

index 834e8b5..51be227 100644 (file)
@@ -144,5 +144,5 @@ libocsrm_env.InstallTarget(libocsrm, 'ocsrm')
 if target_os in ['linux', 'android', 'tizen', 'msys_nt', 'windows'] and libocsrm_env.get('SECURED') == '1':
        SConscript('provisioning/SConscript')
 
-if target_os in ['linux'] and libocsrm_env.get('SECURED') == '1':
+if target_os in ['linux', 'windows'] and libocsrm_env.get('SECURED') == '1':
        SConscript('tool/SConscript')
index 871e7a9..3a5c94f 100644 (file)
@@ -22,6 +22,7 @@ Import('env')
 
 tools_env = env.Clone()
 src_dir = tools_env.get('SRC_DIR')
+target_os = tools_env.get('TARGET_OS')
 
 ######################################################################
 # Build flags
@@ -47,7 +48,14 @@ tools_env.PrependUnique(CPPPATH = ['../../../../extlibs/cjson',
 tools_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-Wextra', '-std=c++0x'])
 tools_env.AppendUnique(LIBPATH = [tools_env.get('BUILD_DIR')])
 tools_env.AppendUnique(RPATH = [tools_env.get('BUILD_DIR')])
-tools_env.PrependUnique(LIBS = ['oc', 'octbstack'])
+
+if target_os in ['msys_nt', 'windows']:
+    # octbstack.dll doesn't export all the functions called by this app, so use static LIBs instead.
+    tools_env.AppendUnique(LIBS = ['ws2_32', 'bcrypt', 'iphlpapi',
+                                   'coap', 'tinydtls', 'mbedtls', 'mbedx509', 'mbedcrypto',
+                                   'octbstack_static', 'ocsrm', 'connectivity_abstraction'])
+else:
+    tools_env.PrependUnique(LIBS = ['oc', 'octbstack'])
 
 ######################################################################
 # Source files and Targets
index 40dc5f9..9806f75 100644 (file)
@@ -44,7 +44,8 @@
 #define TAG  "JSON2CBOR"
 #define MAX_RANGE   ((size_t)-1)
 //SVR database buffer block size
-static const size_t DB_FILE_SIZE_BLOCK = 1023;
+
+#define DB_FILE_SIZE_BLOCK 1023
 
 static OicSecPstat_t* JSONToPstatBin(const char * jsonStr);
 static OicSecDoxm_t* JSONToDoxmBin(const char * jsonStr);
@@ -941,7 +942,7 @@ static OicSecSvc_t* JSONToSvcBin(const char * jsonStr)
             }
 
             cJSON *jsonObj = NULL;
-            unsigned char base64Buff[sizeof(((OicUuid_t*)0)->id)] = {};
+            unsigned char base64Buff[sizeof(((OicUuid_t*)0)->id)] = {0};
             uint32_t outLen = 0;
             B64Result b64Ret = B64_OK;