summaryrefslogtreecommitdiff
path: root/src/scope.rs
diff options
context:
space:
mode:
authorAlex Orlenko <zxteam@protonmail.com>2019-11-29 13:26:30 +0000
committerAlex Orlenko <zxteam@protonmail.com>2019-11-30 00:58:41 +0000
commitfd17a01456452ce98fce41e257da9528ca9420a5 (patch)
tree1c769362d67e52c8f18641235c922e9a2ab34a94 /src/scope.rs
parent7063c80510beb6265242f2fb77392e8845aeac69 (diff)
downloadmlua-fd17a01456452ce98fce41e257da9528ca9420a5.zip
Add Lua 5.2 support
Diffstat (limited to 'src/scope.rs')
-rw-r--r--src/scope.rs6
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);