mirror of
https://github.com/mlua-rs/mlua
synced 2026-06-08 16:05:43 +00:00
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:
@@ -102,10 +102,7 @@ pub type lua_Alloc = unsafe extern "C" fn(
|
||||
nsize: usize,
|
||||
) -> *mut c_void;
|
||||
|
||||
#[cfg_attr(
|
||||
all(windows, feature = "module", feature = "vendored"),
|
||||
link(name = "lua53", kind = "raw-dylib")
|
||||
)]
|
||||
#[cfg_attr(all(windows, raw_dylib), link(name = "lua53", kind = "raw-dylib"))]
|
||||
extern "C" {
|
||||
//
|
||||
// State manipulation
|
||||
@@ -175,20 +172,14 @@ pub const LUA_OPEQ: c_int = 0;
|
||||
pub const LUA_OPLT: c_int = 1;
|
||||
pub const LUA_OPLE: c_int = 2;
|
||||
|
||||
#[cfg_attr(
|
||||
all(windows, feature = "module", feature = "vendored"),
|
||||
link(name = "lua53", kind = "raw-dylib")
|
||||
)]
|
||||
#[cfg_attr(all(windows, raw_dylib), link(name = "lua53", kind = "raw-dylib"))]
|
||||
extern "C" {
|
||||
pub fn lua_arith(L: *mut lua_State, op: c_int);
|
||||
pub fn lua_rawequal(L: *mut lua_State, idx1: c_int, idx2: c_int) -> c_int;
|
||||
pub fn lua_compare(L: *mut lua_State, idx1: c_int, idx2: c_int, op: c_int) -> c_int;
|
||||
}
|
||||
|
||||
#[cfg_attr(
|
||||
all(windows, feature = "module", feature = "vendored"),
|
||||
link(name = "lua53", kind = "raw-dylib")
|
||||
)]
|
||||
#[cfg_attr(all(windows, raw_dylib), link(name = "lua53", kind = "raw-dylib"))]
|
||||
extern "C" {
|
||||
//
|
||||
// Push functions (C -> stack)
|
||||
@@ -279,10 +270,7 @@ pub unsafe fn lua_pcall(L: *mut lua_State, n: c_int, r: c_int, f: c_int) -> c_in
|
||||
lua_pcallk(L, n, r, f, 0, None)
|
||||
}
|
||||
|
||||
#[cfg_attr(
|
||||
all(windows, feature = "module", feature = "vendored"),
|
||||
link(name = "lua53", kind = "raw-dylib")
|
||||
)]
|
||||
#[cfg_attr(all(windows, raw_dylib), link(name = "lua53", kind = "raw-dylib"))]
|
||||
extern "C" {
|
||||
//
|
||||
// Coroutine functions
|
||||
@@ -317,18 +305,12 @@ pub const LUA_GCSETPAUSE: c_int = 6;
|
||||
pub const LUA_GCSETSTEPMUL: c_int = 7;
|
||||
pub const LUA_GCISRUNNING: c_int = 9;
|
||||
|
||||
#[cfg_attr(
|
||||
all(windows, feature = "module", feature = "vendored"),
|
||||
link(name = "lua53", kind = "raw-dylib")
|
||||
)]
|
||||
#[cfg_attr(all(windows, raw_dylib), link(name = "lua53", kind = "raw-dylib"))]
|
||||
extern "C" {
|
||||
pub fn lua_gc(L: *mut lua_State, what: c_int, data: c_int) -> c_int;
|
||||
}
|
||||
|
||||
#[cfg_attr(
|
||||
all(windows, feature = "module", feature = "vendored"),
|
||||
link(name = "lua53", kind = "raw-dylib")
|
||||
)]
|
||||
#[cfg_attr(all(windows, raw_dylib), link(name = "lua53", kind = "raw-dylib"))]
|
||||
extern "C" {
|
||||
//
|
||||
// Miscellaneous functions
|
||||
@@ -484,10 +466,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 = "lua53", kind = "raw-dylib")
|
||||
)]
|
||||
#[cfg_attr(all(windows, raw_dylib), link(name = "lua53", 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;
|
||||
|
||||
Reference in New Issue
Block a user