[Lua] Add support for Lua 5.2 (patch SF#3514593 from Miles Bader)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12968 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
fec1ecc6c5
commit
e3eb54594e
18 changed files with 73 additions and 20 deletions
|
|
@ -2,7 +2,9 @@ require("import") -- the import fn
|
|||
import("enums") -- import lib
|
||||
|
||||
-- catch "undefined" global variables
|
||||
setmetatable(getfenv(),{__index=function (t,i) error("undefined global variable `"..i.."'",2) end})
|
||||
local env = _ENV -- Lua 5.2
|
||||
if not env then env = getfenv () end -- Lua 5.1
|
||||
setmetatable(env, {__index=function (t,i) error("undefined global variable `"..i.."'",2) end})
|
||||
|
||||
-- check values
|
||||
assert(enums.CSP_ITERATION_FWD==0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue