Skip to content

Commit

Permalink
[sb2] Port to lua >=5.2. Contributes to JB#52528
Browse files Browse the repository at this point in the history
  • Loading branch information
Thaodan committed Feb 11, 2021
1 parent 08f1220 commit 652a506
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions scratchbox2/luaif/sblib_luaif.c
Expand Up @@ -237,7 +237,7 @@ int lua_sb_readlink(lua_State *l)
}

/* mappings from c to lua */
static const luaL_reg reg[] =
static const luaL_Reg reg[] =
{
{"log", lua_sb_log},
{"path_exists", lua_sb_path_exists},
Expand All @@ -250,10 +250,12 @@ static const luaL_reg reg[] =

int lua_bind_sblib_functions(lua_State *l)
{
luaL_register(l, "sblib", reg);
lua_newtable(l);
luaL_setfuncs(l, reg, 0);
lua_pushliteral(l,"version");
lua_pushstring(l, "2.0" );
lua_settable(l,-3);
lua_setglobal(l, "sblib");

return 0;
}
6 changes: 4 additions & 2 deletions scratchbox2/sb2d/rule_tree_luaif.c
Expand Up @@ -493,7 +493,7 @@ static int lua_sb_add_net_rule_to_ruletree(lua_State *l)
}

/* mappings from c to lua */
static const luaL_reg reg[] =
static const luaL_Reg reg[] =
{
{"objectlist_create", lua_sb_ruletree_objectlist_create_list},
{"objectlist_set", lua_sb_ruletree_objectlist_set_item},
Expand Down Expand Up @@ -537,10 +537,12 @@ static const luaL_reg reg[] =

int lua_bind_ruletree_functions(lua_State *l)
{
luaL_register(l, "ruletree", reg);
lua_newtable(l);
luaL_setfuncs(l, reg, 0);
lua_pushliteral(l,"version");
lua_pushstring(l, "2.0" );
lua_settable(l,-3);
lua_setglobal(l, "ruletree");

return 0;
}
Expand Down

0 comments on commit 652a506

Please sign in to comment.