From 1fd2c1a37950081200ae87f27aea59a4173a5947 Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Tue, 30 Apr 2024 16:45:18 -0600 Subject: [PATCH] rust/lua: remove lua_int8 feature Now that we're fixed to Lua 5.4, the integer size is always 8. --- configure.ac | 1 - rust/Cargo.toml.in | 1 - rust/src/lua.rs | 10 ++-------- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index 242862722a..c58cf7d869 100644 --- a/configure.ac +++ b/configure.ac @@ -1875,7 +1875,6 @@ # TODO: Update the code to not require this. AC_DEFINE([HAVE_LUA], [1], [lua support available]) AM_CONDITIONAL([HAVE_LUA], [true]) - AC_SUBST([LUA_INT8], ["lua_int8"]) # libmaxminddb AC_ARG_ENABLE(geoip, diff --git a/rust/Cargo.toml.in b/rust/Cargo.toml.in index afb1060af1..65f2a7523a 100644 --- a/rust/Cargo.toml.in +++ b/rust/Cargo.toml.in @@ -18,7 +18,6 @@ debug = true [features] lua = [] -lua_int8 = ["lua"] strict = [] debug = [] debug-validate = [] diff --git a/rust/src/lua.rs b/rust/src/lua.rs index 4fce2a8249..33dfe375f4 100644 --- a/rust/src/lua.rs +++ b/rust/src/lua.rs @@ -21,12 +21,6 @@ use std::os::raw::c_char; use std::os::raw::c_int; use std::os::raw::c_long; -#[cfg(feature = "lua_int8")] -type LuaInteger = i64; - -#[cfg(not(feature = "lua_int8"))] -type LuaInteger = i32; - /// The Rust place holder for lua_State. pub enum CLuaState {} @@ -34,7 +28,7 @@ extern { fn lua_createtable(lua: *mut CLuaState, narr: c_int, nrec: c_int); fn lua_settable(lua: *mut CLuaState, idx: c_long); fn lua_pushlstring(lua: *mut CLuaState, s: *const c_char, len: usize); - fn lua_pushinteger(lua: *mut CLuaState, n: LuaInteger); + fn lua_pushinteger(lua: *mut CLuaState, n: i64); } pub struct LuaState { @@ -63,7 +57,7 @@ impl LuaState { pub fn pushinteger(&self, val: i64) { unsafe { - lua_pushinteger(self.lua, val as LuaInteger); + lua_pushinteger(self.lua, val); } } } -- 2.47.2