diff options
author | Alex Orlenko <zxteam@protonmail.com> | 2019-11-29 13:26:30 +0000 |
---|---|---|
committer | Alex Orlenko <zxteam@protonmail.com> | 2019-11-30 00:58:41 +0000 |
commit | fd17a01456452ce98fce41e257da9528ca9420a5 (patch) | |
tree | 1c769362d67e52c8f18641235c922e9a2ab34a94 /src/scope.rs | |
parent | 7063c80510beb6265242f2fb77392e8845aeac69 (diff) | |
download | mlua-fd17a01456452ce98fce41e257da9528ca9420a5.zip |
Add Lua 5.2 support
Diffstat (limited to 'src/scope.rs')
-rw-r--r-- | src/scope.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/scope.rs b/src/scope.rs index aecf38c..ec354af 100644 --- a/src/scope.rs +++ b/src/scope.rs @@ -175,7 +175,7 @@ impl<'lua, 'scope> Scope<'lua, 'scope> { assert_stack(lua.state, 1); lua.push_ref(&u.0); ffi::lua_getuservalue(lua.state, -1); - #[cfg(any(feature = "lua51", feature = "luajit"))] + #[cfg(any(feature = "lua52", feature = "lua51", feature = "luajit"))] { ffi::lua_pushinteger(lua.state, 1); ffi::lua_gettable(lua.state, -2); @@ -247,9 +247,9 @@ impl<'lua, 'scope> Scope<'lua, 'scope> { push_userdata(lua.state, ())?; #[cfg(feature = "lua53")] ffi::lua_pushlightuserdata(lua.state, data.as_ptr() as *mut c_void); - #[cfg(any(feature = "lua51", feature = "luajit"))] + #[cfg(any(feature = "lua52", feature = "lua51", feature = "luajit"))] protect_lua_closure(lua.state, 0, 1, |state| { - // Lua 5.1 allows to store only table. Then we will wrap the value. + // Lua 5.2/5.1 allows to store only table. Then we will wrap the value. ffi::lua_createtable(state, 1, 0); ffi::lua_pushinteger(state, 1); ffi::lua_pushlightuserdata(state, data.as_ptr() as *mut c_void); |