From 60ed674fcea480dc0251b2eeefb368d175a6b553 Mon Sep 17 00:00:00 2001 From: Kevin Mitchell Date: Sat, 18 Oct 2014 22:37:46 -0700 Subject: lua: fix lua_objlen -> lua_rawlen for lua 5.2 --- player/lua.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/player/lua.c b/player/lua.c index b9ac756bf1..d99a37a781 100644 --- a/player/lua.c +++ b/player/lua.c @@ -81,6 +81,7 @@ struct script_ctx { #if LUA_VERSION_NUM <= 501 #define mp_cpcall lua_cpcall +#define mp_lua_len lua_objlen #else // Curse whoever had this stupid idea. Curse whoever thought it would be a good // idea not to include an emulated lua_cpcall() even more. @@ -90,6 +91,7 @@ static int mp_cpcall (lua_State *L, lua_CFunction func, void *ud) lua_pushlightuserdata(L, ud); return lua_pcall(L, 1, 0, 0); } +#define mp_lua_len lua_rawlen #endif static int destroy_crap(lua_State *L) @@ -1175,7 +1177,7 @@ static int script_subprocess(lua_State *L) resume_all(ctx); lua_getfield(L, 1, "args"); // args - int num_args = lua_objlen(L, -1); + int num_args = mp_lua_len(L, -1); char *args[256]; if (num_args > MP_ARRAY_SIZE(args) - 1) // last needs to be NULL luaL_error(L, "too many arguments"); -- cgit v1.2.3