With GCC 11.3:
warning: implicit declaration of function ‘luaL_openlib’; did you mean ‘luaI_openlib’? [-Wimplicit-function-declaration]
Lua 5.1 replaced luaL_openlib with luaL_register
https://www.lua.org/manual/5.1/manual.html#7.3 You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany-plugins/pull/1210
-- Commit Summary --
* GeanyLua: Use luaL_register instead of luaL_openlib
-- File Changes --
M geanylua/glspi_kfile.c (4) M geanylua/glspi_run.c (4) M geanylua/gsdlg_lua.c (4)
-- Patch Links --
https://github.com/geany/geany-plugins/pull/1210.patch https://github.com/geany/geany-plugins/pull/1210.diff
Did the changes work for you? With these changes, Geany crashes when using any of the example scripts.
Oops, sorry you're right. There was a luaL_openlib***s***, converted incorrectly.
PR updated to put that back: ```diff --- a/geanylua/glspi_run.c +++ b/geanylua/glspi_run.c @@ -246,7 +246,7 @@ static lua_State *glspi_state_new(void) { lua_State *L = luaL_newstate(); StateInfo*si=g_new0(StateInfo,1); - luaL_register(L, NULL, NULL); + luaL_openlibs(L); si->state=L; si->timer=g_timer_new(); si->max=DEFAULT_MAX_EXEC_TIME; ```
This does now work for me.
Merged #1210 into master.
Thank you!
github-comments@lists.geany.org