Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Add support for compiling for LuaJIT #1

Open
FoxieFlakey opened this issue Nov 27, 2020 · 2 comments
Open

[FEATURE] Add support for compiling for LuaJIT #1

FoxieFlakey opened this issue Nov 27, 2020 · 2 comments

Comments

@FoxieFlakey
Copy link

please add support for compiling for LuaJIT not only for Lua5.3

@FoxieFlakey
Copy link
Author

because it wont compile for LuaJIT

@FoxieFlakey
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant