Skip to content

Failed build with latest LuaJIT #21

@dndx

Description

@dndx

Inside de97b9d, Mike added the implementation of API luaL_setfuncs(). Unfortunately, this causes lua-cjson build to fail because of redefinition of luaL_setfuncs().

[datong@localhost lua-cjson]$ make LUA_INCLUDE_DIR=/home/datong/lj-nopool/include/luajit-2.1
cc -c -O3 -Wall -pedantic -DNDEBUG  -I/home/datong/lj-nopool/include/luajit-2.1 -fpic -o lua_cjson.o lua_cjson.c
lua_cjson.c:1350: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/datong/lj-nopool/include/luajit-2.1/lauxlib.h:88:14: note: previous declaration of ‘luaL_setfuncs’ was here
 LUALIB_API void (luaL_setfuncs) (lua_State *L, const luaL_Reg *l, int nup);
              ^
Makefile:90: recipe for target 'lua_cjson.o' failed
make: *** [lua_cjson.o] Error 1

Since there is no obvious macro we can use to test this change, I propose we use #ifdef luaL_newlibtable which was added as part of the same commit. I can confirm no other OpenResty project is defining luaL_newlibtable symbol and thus it should do the trick.

PR coming shortly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions