Add `push_closure`
This commit is contained in:
parent
cf37264d9a
commit
64ade67496
|
@ -109,7 +109,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gmod"
|
name = "gmod"
|
||||||
version = "15.0.1"
|
version = "15.0.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg_table",
|
"cfg_table",
|
||||||
"cstr",
|
"cstr",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "gmod"
|
name = "gmod"
|
||||||
version = "15.0.1"
|
version = "15.0.2"
|
||||||
authors = ["William Venner <william@venner.io>"]
|
authors = ["William Venner <william@venner.io>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
|
@ -315,6 +315,12 @@ impl LuaState {
|
||||||
(LUA_SHARED.lua_pushcclosure)(*self, func, 0)
|
(LUA_SHARED.lua_pushcclosure)(*self, func, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
|
pub unsafe fn push_closure(&self, func: LuaFunction, n: i32) {
|
||||||
|
debug_assert!(n <= 255, "Can't push more than 255 arguments into a closure");
|
||||||
|
(LUA_SHARED.lua_pushcclosure)(*self, func, n)
|
||||||
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub unsafe fn set_table(&self, index: i32) {
|
pub unsafe fn set_table(&self, index: i32) {
|
||||||
(LUA_SHARED.lua_settable)(*self, index)
|
(LUA_SHARED.lua_settable)(*self, index)
|
||||||
|
|
Loading…
Reference in New Issue