lua-rapidjson
lua-rapidjson copied to clipboard
A JSON module for Lua based on the very fast RapidJSON library.
xLua:[v2.1.16]https://github.com/Tencent/xLua/releases/tag/v2.1.16 lua-rapidjson: [v2.1.16]https://github.com/xpol/lua-rapidjson/releases/tag/v0.7.1 cmake 3.23.1 gcc 13.1.6 (clang-1316.0.21.2.3) xLua的CMakeLists中添加如下: #begin lua-rapidjson set (RAPIDJSON_SRC lua-rapidjson/source/Document.cpp lua-rapidjson/source/rapidjson.cpp lua-rapidjson/source/Schema.cpp lua-rapidjson/source/values.cpp ) set_property( SOURCE ${RAPIDJSON_SRC} APPEND PROPERTY COMPILE_DEFINITIONS LUA_LIB ) list(APPEND THIRDPART_INC lua-rapidjson/include) set...
```lua local json = require('rapidjson') local schema = { type = "object", properties = { key = {type = "string"}, secret = {type = "string", default = "xxxxxxxxx"} } }...
Environmental : centos7 kernel: 3.10.0-862.14.4.el7.x86_64 gdb ``` (gdb) bt #0 0x00007fa1ad141caa in __memcpy_ssse3_back () from /lib64/libc.so.6 #1 0x00007fa1aa9e8193 in rapidjson::GenericSchemaValidator::AddErrorLocation ( this=this@entry=0x18044a0, result=..., parent=) at /tmp/lua-rapidjson/rapidjson/include/rapidjson/schema.h:2338 #2 0x00007fa1aa9e8982 in rapidjson::GenericSchemaValidator::AddCurrentError...
https://github.com/xpol/lua-rapidjson/blob/master/CMakeLists.txt#L68 the target_compile_features() command was added in cmake 3.1, so https://github.com/xpol/lua-rapidjson/blob/master/CMakeLists.txt#L1 cmake 2.8 can not build. maybe we can remove `target_compile_features`?
I finally successfully compiled the library on Windows with mingw32 (TDM-GCC), with some modifications. I opened this issue to see if the compilation process could be improved. ```diff --- file2.hpp...
lua version: 5.3.5 build from source, downloaded from lua.org gcc: 7.4.0 cmake: 3.13.4 luarocks: 3.0.4 ``` $ make [ 20%] Linking CXX shared module rapidjson.so CMakeFiles/lua-rapidjson.dir/src/Document.cpp.o:在函数‘pushParseResult’中: /home/Dell/opensource/lua-rapidjson/src/Document.cpp:62:对‘lua_pushboolean’未定义的引用 /home/Dell/opensource/lua-rapidjson/src/Document.cpp:62:(.text+0x16): 截断重寻址至相符: R_X86_64_PC32...
local rapidjson = require('rapidjson') local a = '{"aa":9223372036854775807}' local o1 = rapidjson.decode(a) print(o1.aa) print(rapidjson.encode(o1)) local b = '{"aa":9223372036854775808}' local o2 = rapidjson.decode(b) print(o2.aa) print(rapidjson.encode(o2))
https://github.com/xpol/lua-rapidjson/blob/c06b8a64a1c4173e2c38651952e0ead0372dd5e5/src/Schema.cpp#L68-L72 This creates a dangling reference if the SchemaDocument used to construct the SchemaValidator goes out of scope and is thus garbage collected. The constructor of SchemaValidator expects a **reference**...
### platform windows10, mingw64 with cmake ### problem * building when using 'luarocks --tree luamodules install rapidjson', the ld.exe will throw a link error: ``` D:/ProgramFiles/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find D:ProgramFileslua51bin/lua51.dll: No...
不支持 ios、osx、osx_silicon 系统. 麻烦作者,抽空研究一下。