From faf19e4a06183cf0abd271f50d11079488aef3f6 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Wed, 13 Jan 2021 20:01:12 -0800 Subject: [PATCH] Allow luajit to build in the pointer size cross compilation case --- build/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build/main.rs b/build/main.rs index 79a6c7b..0aa1e78 100644 --- a/build/main.rs +++ b/build/main.rs @@ -141,7 +141,6 @@ fn generate_glue() -> std::io::Result<()> { write!(glue, "pub type LUA_UNSIGNED = u64;\n")?; let version = if cfg!(feature = "luajit") || cfg!(feature = "lua51") { - // Note: luajit is ~lua 5.1, but it doesn't itself cross compile (5, 1, 0) } else if cfg!(feature = "lua52") { (5, 2, 0) @@ -192,7 +191,11 @@ fn generate_glue() -> std::io::Result<()> { write!( glue, r#" +#[cfg(feature = "luajit")] +pub const LUA_BITLIBNAME: &str = "bit"; +#[cfg(not(feature = "luajit"))] pub const LUA_BITLIBNAME: &str = "bit32"; + pub const LUA_COLIBNAME: &str = "coroutine"; pub const LUA_DBLIBNAME: &str = "debug"; pub const LUA_IOLIBNAME: &str = "io"; @@ -203,6 +206,8 @@ pub const LUA_STRLIBNAME: &str = "string"; pub const LUA_TABLIBNAME: &str = "table"; pub const LUA_UTF8LIBNAME: &str = "utf8"; +pub const LUA_JITLIBNAME: &str = "jit"; +pub const LUA_FFILIBNAME: &str = "ffi"; "# )?;