[FEATURE] Add support for compiling for LuaJIT
Opened this issue · 2 comments
FoxieFlakey commented
please add support for compiling for LuaJIT not only for Lua5.3
FoxieFlakey commented
because it wont compile for LuaJIT
FoxieFlakey commented
Compilation fail with
cc -O3 -I/usr/include/luajit-2.1 -fPIC -shared -o yieldhook.so yieldhook.c -s
yieldhook.c: In function ‘hookf’:
yieldhook.c:67:3: warning: implicit declaration of function ‘lua_rawgetp’; did you mean ‘lua_rawgeti’? [-Wimplicit-function-declaration]
67 | lua_rawgetp(L, LUA_REGISTRYINDEX, &HOOKKEY);
| ^~~~~~~~~~~
| lua_rawgeti
yieldhook.c:69:7: error: void value not ignored as it ought to be
69 | if (lua_rawget(L, -2) == LUA_TFUNCTION) { /* is there a hook function? */
| ^~~~~~~~~~~~~~~~~
yieldhook.c:21:29: error: ‘LUA_HOOKTAILCALL’ undeclared (first use in this function); did you mean ‘LUA_HOOKTAILRET’?
21 | #define LUA_MASKYIELD (1 << LUA_HOOKTAILCALL)
| ^~~~~~~~~~~~~~~~
yieldhook.c:77:32: note: in expansion of macro ‘LUA_MASKYIELD’
77 | && (lua_get