Skip to content

Commit cc57bed

Browse files
committed
Update Luau to 0.657
1 parent b5d38ab commit cc57bed

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

mlua-sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ cfg-if = "1.0"
4040
pkg-config = "0.3.17"
4141
lua-src = { version = ">= 547.0.0, < 547.1.0", optional = true }
4242
luajit-src = { version = ">= 210.5.0, < 210.6.0", optional = true }
43-
luau0-src = { version = "0.11.1", optional = true }
43+
luau0-src = { version = "0.12.0", optional = true }
4444

4545
[lints.rust]
4646
unexpected_cfgs = { level = "allow", check-cfg = ['cfg(raw_dylib)'] }

mlua-sys/src/luau/luacode.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! Contains definitions from `luacode.h`.
22
3+
use std::marker::{PhantomData, PhantomPinned};
34
use std::os::raw::{c_char, c_int, c_void};
45
use std::{ptr, slice};
56

@@ -15,6 +16,10 @@ pub struct lua_CompileOptions {
1516
pub vectorType: *const c_char,
1617
pub mutableGlobals: *const *const c_char,
1718
pub userdataTypes: *const *const c_char,
19+
pub librariesWithKnownMembers: *const *const c_char,
20+
pub libraryMemberTypeCallback: Option<lua_LibraryMemberTypeCallback>,
21+
pub libraryMemberConstantCallback: Option<lua_LibraryMemberConstantCallback>,
22+
pub disabledBuiltins: *const *const c_char,
1823
}
1924

2025
impl Default for lua_CompileOptions {
@@ -29,10 +34,34 @@ impl Default for lua_CompileOptions {
2934
vectorType: ptr::null(),
3035
mutableGlobals: ptr::null(),
3136
userdataTypes: ptr::null(),
37+
librariesWithKnownMembers: ptr::null(),
38+
libraryMemberTypeCallback: None,
39+
libraryMemberConstantCallback: None,
40+
disabledBuiltins: ptr::null(),
3241
}
3342
}
3443
}
3544

45+
#[repr(C)]
46+
pub struct lua_CompileConstant {
47+
_data: [u8; 0],
48+
_marker: PhantomData<(*mut u8, PhantomPinned)>,
49+
}
50+
51+
pub type lua_LibraryMemberTypeCallback =
52+
extern "C" fn(library: *const c_char, member: *const c_char) -> c_int;
53+
54+
pub type lua_LibraryMemberConstantCallback =
55+
extern "C" fn(library: *const c_char, member: *const c_char, constant: *mut lua_CompileConstant);
56+
57+
extern "C" {
58+
fn luau_set_compile_constant_nil(constant: *mut lua_CompileConstant);
59+
fn luau_set_compile_constant_boolean(constant: *mut lua_CompileConstant, b: c_int);
60+
fn luau_set_compile_constant_number(constant: *mut lua_CompileConstant, n: f64);
61+
fn luau_set_compile_constant_vector(constant: *mut lua_CompileConstant, x: f32, y: f32, z: f32, w: f32);
62+
fn luau_set_compile_constant_string(constant: *mut lua_CompileConstant, s: *const c_char, l: usize);
63+
}
64+
3665
extern "C-unwind" {
3766
#[link_name = "luau_compile"]
3867
pub fn luau_compile_(

0 commit comments

Comments
 (0)