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

geanylua: Migrate to Lua 5.3 #1235

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

geanylua: Migrate to Lua 5.3 #1235

wants to merge 6 commits into from

Conversation

techee
Copy link
Member

@techee techee commented Mar 5, 2023

This PR migrates geanylua to Lua 5.3 (my oldish distro doesn't provide lua 5.4 so I didn't test, maybe it works too). There were mostly just simple changes. From my limited testing, everything seems to work.

Posting as an (in my opinion better) alternative to #1233

techee added 6 commits March 5, 2023 23:25
With the NULL second parameter luaL_register() is equivalent to
luaL_setfuncs() as described e.g. here

https://wiki.gentoo.org/wiki/Lua/Porting_notes
luaL_register() can be replaced by:

1. creating a new table
2. adding the functions to it using luaL_setfuncs()
3. publishing this table globally by lua_setglobal()

Since these tables are registered just once, we don't care about the
special cases described below and the "merging" problem.

https://stackoverflow.com/questions/19041215/lual-openlib-replacement-for-lua-5-2
The documentation says these are identical.
LUA_GLOBALSINDEX is gone now but we can use the whole code below (the
original traceback reporting code was also stolen from here):

https://github.com/lua/lua/blob/cf08915d62e338c987b71c078b148490510e9fe7/lua.c#L248
@techee
Copy link
Member Author

techee commented Mar 5, 2023

OK, I just tried on another VM and it compiles and runs with Lua 5.4 too, without any modifications. The only time some modifications were needed was for 5.1->5.2 transition, the 5.2->5.3 transition didn't require any change either.

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

Successfully merging this pull request may close these issues.

1 participant