diff --git a/src/ffi/lua51/lua.rs b/src/ffi/lua51/lua.rs index 3ad2db5..6c99503 100644 --- a/src/ffi/lua51/lua.rs +++ b/src/ffi/lua51/lua.rs @@ -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; diff --git a/src/ffi/lua52/lua.rs b/src/ffi/lua52/lua.rs index 44097da..f8c7108 100644 --- a/src/ffi/lua52/lua.rs +++ b/src/ffi/lua52/lua.rs @@ -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;