Support LUA_LIB_NAME in module mode for windows.

In this mode we will link with the particular lua library.
This commit is contained in:
Alex Orlenko
2023-07-21 00:54:14 +01:00
parent ead6be4a52
commit df9251fb52
14 changed files with 56 additions and 167 deletions
+4 -16
View File
@@ -89,10 +89,7 @@ pub type lua_Alloc = unsafe extern "C" fn(
nsize: usize,
) -> *mut c_void;
#[cfg_attr(
all(windows, feature = "module", feature = "vendored"),
link(name = "lua51", kind = "raw-dylib")
)]
#[cfg_attr(all(windows, raw_dylib), link(name = "lua51", kind = "raw-dylib"))]
extern "C" {
//
// State manipulation
@@ -222,10 +219,7 @@ pub const LUA_GCSTEP: c_int = 5;
pub const LUA_GCSETPAUSE: c_int = 6;
pub const LUA_GCSETSTEPMUL: c_int = 7;
#[cfg_attr(
all(windows, feature = "module", feature = "vendored"),
link(name = "lua51", kind = "raw-dylib")
)]
#[cfg_attr(all(windows, raw_dylib), link(name = "lua51", kind = "raw-dylib"))]
extern "C" {
pub fn lua_gc(L: *mut lua_State, what: c_int, data: c_int) -> c_int;
}
@@ -233,10 +227,7 @@ extern "C" {
//
// Miscellaneous functions
//
#[cfg_attr(
all(windows, feature = "module", feature = "vendored"),
link(name = "lua51", kind = "raw-dylib")
)]
#[cfg_attr(all(windows, raw_dylib), link(name = "lua51", kind = "raw-dylib"))]
extern "C" {
pub fn lua_error(L: *mut lua_State) -> !;
pub fn lua_next(L: *mut lua_State, idx: c_int) -> c_int;
@@ -362,10 +353,7 @@ pub const LUA_MASKCOUNT: c_int = 1 << (LUA_HOOKCOUNT as usize);
/// Type for functions to be called on debug events.
pub type lua_Hook = unsafe extern "C" fn(L: *mut lua_State, ar: *mut lua_Debug);
#[cfg_attr(
all(windows, feature = "module", feature = "vendored"),
link(name = "lua51", kind = "raw-dylib")
)]
#[cfg_attr(all(windows, raw_dylib), link(name = "lua51", kind = "raw-dylib"))]
extern "C" {
pub fn lua_getstack(L: *mut lua_State, level: c_int, ar: *mut lua_Debug) -> c_int;
pub fn lua_getinfo(L: *mut lua_State, what: *const c_char, ar: *mut lua_Debug) -> c_int;