diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 6b64564..ce5199f 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -4,9 +4,7 @@ "name": "Linux", "includePath": [ "${workspaceFolder}/**", - "${workspaceFolder}/include", - "${workspaceFolder}/build/_deps/json-src/include/nlohmann", - "${workspaceFolder}/build/_deps/json-src/include" + "${workspaceFolder}/include" ], "defines": ["CROSSLANG_ENABLE_JSON=1","CROSSLANG_ENABLE_THREADING=1","CROSSLANG_ENABLE_FILE_IO=1","CROSSLANG_ENABLE_NETWORK=1","CROSSLANG_ENABLE_TERMIOS=1","CROSSLANG_ENABLE_MBED=1","CROSSLANG_ENABLE_SQLITE=1","CROSSLANG_ENABLE_SDL2=1","-DCROSSLANG_ENABLE_PROCESS=1"], "compilerPath": "/usr/bin/gcc", diff --git a/CMakeLists.txt b/CMakeLists.txt index a5c1b57..16d6636 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.20) +cmake_minimum_required(VERSION 3.16) project(TessesCrossLang VERSION 1.0) diff --git a/src/runtime_methods/json.cpp b/src/runtime_methods/json.cpp index 4ca15d8..0f810e1 100644 --- a/src/runtime_methods/json.cpp +++ b/src/runtime_methods/json.cpp @@ -72,7 +72,7 @@ namespace Tesses::CrossLang for(auto item : dict->items) { if(IsValidForJson(item.second)) - json_object_setn_new(obj, item.first.c_str(), item.first.size(),JsonSerialize(item.second)); + json_object_set_new(obj, item.first.c_str(),JsonSerialize(item.second)); } return obj; } @@ -130,11 +130,11 @@ namespace Tesses::CrossLang size_t len; json_t* value; - json_object_keylen_foreach_safe(json,n,key,len,value) + json_object_foreach_safe(json,n,key,value) { auto itemRes = JsonDeserialize(ls2,value); ls2.GetGC()->BarrierBegin(); - dict->SetValue(std::string(key,len),itemRes); + dict->SetValue(std::string(key),itemRes); ls2.GetGC()->BarrierEnd(); } return dict;