diff options
author | ChrisK2 <spam@kalania.de> | 2014-10-19 08:10:10 +0200 |
---|---|---|
committer | ChrisK2 <spam@kalania.de> | 2014-10-19 08:10:10 +0200 |
commit | 78151efc7e79edaf5ff7daa43ed6a3929159b0ae (patch) | |
tree | a8a56621d65531c53473d2e004581d74b64aaf4d /player | |
parent | ff029cb4cfae6e9984821d5f9c9dd49c2d566f96 (diff) | |
parent | 60ed674fcea480dc0251b2eeefb368d175a6b553 (diff) | |
download | mpv-78151efc7e79edaf5ff7daa43ed6a3929159b0ae.tar.bz2 mpv-78151efc7e79edaf5ff7daa43ed6a3929159b0ae.tar.xz |
Merge pull request #1195 from kevmitch/luafix
lua: fix lua_objlen -> lua_rawlen for lua 5.2
Diffstat (limited to 'player')
-rw-r--r-- | player/lua.c | 4 |
1 files changed, 3 insertions, 1 deletions
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"); |