jmckaskill / luaffi

Standalone FFI library for calling C functions from lua. Compatible with the luajit FFI interface.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: lua_remove undeclared under Lua 5.3

vlaze opened this issue · comments

I've been trying to compile your luaffi release following the README file. However, I get an error which won't let me continue:

call.c: In function ‘reserve_code’:
call.c:179:31: error: ‘lua_remove’ undeclared (first use in this function)
         ADDFUNC(jit->lua_dll, lua_remove);

As far as I could investigate, this is caused because lua_remove has become a macro in Lua 5.3, which is the one I am using. Is there any workaround I could use? Feel free to ask for more information if you require it.

commented

I added this into call.c so it can resolve the macro as a function:

static void (lua_remove)(lua_State *L, int idx) {
    lua_remove(L, idx);
}

If you check the first lines of call.c you can see that push_float etc is already wrapped in this way