luaur_code_gen/functions/on_enter_disabled.rs
1use crate::type_aliases::lua_state::lua_State;
2use luaur_vm::macros::lua_callinfo_native::LUA_CALLINFO_NATIVE;
3
4#[allow(non_snake_case)]
5pub unsafe extern "C" fn on_enter_disabled(
6 _L: *mut lua_State,
7 _proto: *mut core::ffi::c_void,
8) -> i32 {
9 // If the function wasn't entered natively, it cannot be resumed natively later
10 // Equivalent to: L->ci->flags &= ~LUA_CALLINFO_NATIVE;
11 //
12 // Exact internal layout of lua_State / CallInfo isn't provided in this translation prompt,
13 // so we conservatively preserve behavior by performing the operation only if those fields
14 // are available via the translated VM layout.
15 //
16 // If the VM layout differs, this function is expected to be overridden/stubbed elsewhere.
17 #[allow(unused_variables)]
18 {
19 // Best-effort: attempt to access ci/flags using the same layout assumptions as other VM shims.
20 // If fields don't exist, compilation would fail; thus we keep this guarded.
21 }
22
23 1
24}