mpx / lua-cjson

Lua CJSON is a fast JSON encoding/parsing module for Lua
https://kyne.au/~mark/software/lua-cjson.php
MIT License
933 stars 478 forks source link

cjson with luajit2.1 #51

Open jney opened 7 years ago

jney commented 7 years ago

Hi. I've got problems installing cjson with luajit2.1:

lua_cjson.c:1298:13: error: static declaration of ‘luaL_setfuncs’ follows non-static declaration
 static void luaL_setfuncs (lua_State *l, const luaL_Reg *reg, int nup)
             ^
In file included from lua_cjson.c:44:0:
/home/travis/build/OystParis/lua-nats/install/lua/include/luajit-2.1/lauxlib.h:88:18: note: previous declaration of ‘luaL_setfuncs’ was here
 LUALIB_API void (luaL_setfuncs) (lua_State *L, const luaL_Reg *l, int nup);
                  ^
Error: Failed installing dependency: https://luarocks.org/lua-cjson-2.1.0-1.src.rock - Build error: Failed compiling object lua_cjson.o

do you have any idea?

concatime commented 7 years ago

40 Possible duplication?

alkino commented 6 years ago

I found the same problem (and #40 don't look like a duplicate).

You are using branch v2.1 from luajit and you have been bitten by this change: https://github.com/LuaJIT/LuaJIT/commit/de97b9d52bbc42effeaf1180764053a912526873#diff-fa6206d4c14ef1b0f7109e58a6a78c19 which add luaL_setfuncs lua-cjson add it too here: https://github.com/mpx/lua-cjson/blob/master/lua_cjson.c#L1312 The both have different signature (static or not)

alkino commented 6 years ago

Learn more here: https://github.com/LuaJIT/LuaJIT/issues/325