-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build LuaJIT w/ table.pack support (#388)
c.f., koreader/koreader-base#1535 Note that I left a couple of `{...}` constructs alone in android.lua, because some were then passing the table to `table.concat`, which *will* choke on a nil (and it gets to iterate over it in a packed vararg table).
- Loading branch information
Showing
3 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
diff --git a/src/lib_table.c b/src/lib_table.c | ||
index a723326a..28af227f 100644 | ||
--- a/src/lib_table.c | ||
+++ b/src/lib_table.c | ||
@@ -267,7 +267,6 @@ LJLIB_CF(table_sort) | ||
return 0; | ||
} | ||
|
||
-#if LJ_52 | ||
LJLIB_PUSH("n") | ||
LJLIB_CF(table_pack) | ||
{ | ||
@@ -283,7 +282,6 @@ LJLIB_CF(table_pack) | ||
lj_gc_check(L); | ||
return 1; | ||
} | ||
-#endif | ||
|
||
LJLIB_NOREG LJLIB_CF(table_new) LJLIB_REC(.) | ||
{ | ||
@@ -316,10 +314,8 @@ static int luaopen_table_clear(lua_State *L) | ||
LUALIB_API int luaopen_table(lua_State *L) | ||
{ | ||
LJ_LIB_REG(L, LUA_TABLIBNAME, table); | ||
-#if LJ_52 | ||
lua_getglobal(L, "unpack"); | ||
lua_setfield(L, -2, "unpack"); | ||
-#endif | ||
lj_lib_prereg(L, LUA_TABLIBNAME ".new", luaopen_table_new, tabV(L->top-1)); | ||
lj_lib_prereg(L, LUA_TABLIBNAME ".clear", luaopen_table_clear, tabV(L->top-1)); | ||
return 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters