Skip to content

Conversation

hadess
Copy link

@hadess hadess commented Jun 20, 2016

Lua 5.2 and 5.3 support, as well as porting to libarchive 3.0.

Untested.

@@ -38,8 +38,12 @@ static int ar_version(lua_State *L) {
}

//////////////////////////////////////////////////////////////////////
#if !defined LUA_VERSION_NUM
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this #if be refactored into a header (perhaps ar.h?) so we can avoid copying it into ar_entry.c?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

hadess added 5 commits June 21, 2016 16:11
From http://lua-users.org/wiki/CompatibilityWithLuaFive:
luaL_reg (Lua 5.0) changed its name to luaL_Reg since Lua 5.1.

Apply the recommended fix to support lua 5.1 and prior versions.
Use lua_getuservalue()/lua_setuservalue() instead of the removed
lua_getfenv()/lua_setfenv().
Replace the deprecated functions with their libarchive 3.0 replacements
as listed at:
https://github.com/libarchive/libarchive/wiki/ManPageLibarchiveChanges3
"wrote" was checked against -1 but was never actually set.
When running the tests, libarchive says:
InvalidFFlag: 'archive' is not a known fflag

So remove that one flag from our tests.
@hadess
Copy link
Author

hadess commented Jun 21, 2016

Note that I had to disable the "__gc" functions for the code to work and the tests to pass on Lua 5.3.

I don't think that the existing code should regress on 5.1 or older, but I'm still investigating the problems with newer Lua versions.

@tomprince
Copy link

It at least compiles and loads for me.

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.

3 participants