diff options
author | wm4 <wm4@nowhere> | 2015-04-01 23:59:09 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-04-01 23:59:15 +0200 |
commit | 9b59c175e389e0a0561312139c0861eba37e4719 (patch) | |
tree | 8011a6152135c145923bd11ea55eb8fee61dc311 /player | |
parent | f9db94ab71ccaf1e5639f28e69f07ccc164e130f (diff) | |
download | mpv-9b59c175e389e0a0561312139c0861eba37e4719.tar.bz2 mpv-9b59c175e389e0a0561312139c0861eba37e4719.tar.xz |
lua: reject Lua 5.3
It simply doesn't work, and is hard to make work. Lua 5.3 is a different
language from 5.1 and 5.2, and is different enough to make adding
support a major issue. Most importantly, 5.3 introduced integer types,
which completely mess up any code which deals with numbers.
I tried to make this a compile time check, but failed. Still at least
try to avoid selecting the 5.3 pkg-config package when the generic "lua"
name is used (why can't Lua upstream just provide an official .pc
file...). Maybe this actually covers all cases.
Fixes #1729 (kind of).
Diffstat (limited to 'player')
-rw-r--r-- | player/lua.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/player/lua.c b/player/lua.c index 7e44ec4c58..43f549b4ed 100644 --- a/player/lua.c +++ b/player/lua.c @@ -377,6 +377,11 @@ static int load_lua(struct mpv_handle *client, const char *fname) .filename = fname, }; + if (LUA_VERSION_NUM != 501 && LUA_VERSION_NUM != 502) { + MP_FATAL(ctx, "Only Lua 5.1 and 5.2 are supported.\n"); + goto error_out; + } + lua_State *L = ctx->state = luaL_newstate(); if (!L) goto error_out; |