Update type of lua_Integer for lua51/52

This commit is contained in:
Alex Orlenko 2022-05-27 12:26:56 +01:00
parent 62db3adde1
commit 93f0b2a5de
No known key found for this signature in database
GPG key ID: 4C150C250863B96D
2 changed files with 8 additions and 2 deletions

View file

@ -67,7 +67,10 @@ pub const LUA_MINSTACK: c_int = 20;
pub type lua_Number = c_double;
/// A Lua integer, usually equivalent to `i64`
pub type lua_Integer = isize;
#[cfg(target_pointer_width = "32")]
pub type lua_Integer = i32;
#[cfg(target_pointer_width = "64")]
pub type lua_Integer = i64;
/// Type for native C functions that can be passed to Lua.
pub type lua_CFunction = unsafe extern "C" fn(L: *mut lua_State) -> c_int;

View file

@ -69,7 +69,10 @@ pub const LUA_RIDX_LAST: lua_Integer = LUA_RIDX_GLOBALS;
pub type lua_Number = c_double;
/// A Lua integer, usually equivalent to `i64`
pub type lua_Integer = isize;
#[cfg(target_pointer_width = "32")]
pub type lua_Integer = i32;
#[cfg(target_pointer_width = "64")]
pub type lua_Integer = i64;
/// A Lua unsigned integer, equivalent to `u32` in Lua 5.2
pub type lua_Unsigned = c_uint;