factorio_mlua_sys/lua53/
compat.rs

1//! MLua compatibility layer for Lua 5.3
2
3use std::os::raw::c_int;
4
5use super::lua::*;
6
7#[inline(always)]
8pub unsafe fn lua_resume(
9    L: *mut lua_State,
10    from: *mut lua_State,
11    narg: c_int,
12    nres: *mut c_int,
13) -> c_int {
14    let ret = lua_resume_(L, from, narg);
15    if (ret == LUA_OK || ret == LUA_YIELD) && !(nres.is_null()) {
16        *nres = lua_gettop(L);
17    }
18    ret
19}