From 90ed18a41fef137ed0637cf9fc6aa667de2c905f Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sun, 8 Mar 2026 22:43:34 +0800 Subject: Update dependencies and add C bindings generation --- systems/_constants/macros/src/lib.rs | 6 ++---- systems/_constants/src/lib.rs | 2 -- systems/sheet/Cargo.toml | 6 +++--- systems/sheet/src/sheet/reader.rs | 6 ++---- 4 files changed, 7 insertions(+), 13 deletions(-) (limited to 'systems') diff --git a/systems/_constants/macros/src/lib.rs b/systems/_constants/macros/src/lib.rs index d7b7059..7384182 100644 --- a/systems/_constants/macros/src/lib.rs +++ b/systems/_constants/macros/src/lib.rs @@ -184,10 +184,8 @@ fn generate_functions_with_params( let ffi_fn_name = format!("JV_Const_{}{}", pascal_prefix, pascal_name); let ffi_fn_ident = Ident::new(&ffi_fn_name, const_name.span()); - // Generate parameter list for FFI - let ffi_param_idents: Vec = (0..params.len()) - .map(|i| Ident::new(&format!("p{}", i), value_span)) - .collect(); + // Generate parameter list for FFI using original parameter names + let ffi_param_idents: Vec = params.iter().map(|p| Ident::new(p, value_span)).collect(); let ffi_param_decls = ffi_param_idents.iter().map(|ident| { quote! { #ident: *const libc::c_char } diff --git a/systems/_constants/src/lib.rs b/systems/_constants/src/lib.rs index 30ea89b..c9dee11 100644 --- a/systems/_constants/src/lib.rs +++ b/systems/_constants/src/lib.rs @@ -8,8 +8,6 @@ macro_rules! c { pub const TEMP_FILE_PREFIX: &str = ".tmp_"; pub const LOCK_FILE_PREFIX: &str = "~"; -pub const CURRENT_SHEET_VERSION: u8 = 0; - /// File and directory path constants for the server root #[allow(unused)] pub mod server { diff --git a/systems/sheet/Cargo.toml b/systems/sheet/Cargo.toml index 1151c8d..33d17dc 100644 --- a/systems/sheet/Cargo.toml +++ b/systems/sheet/Cargo.toml @@ -12,10 +12,10 @@ asset_system = { path = "../_asset" } serde = { version = "1", features = ["derive"] } -tokio = { version = "1.48", features = ["full"] } +tokio = { version = "1.50", features = ["full"] } -thiserror = "1.0.69" +thiserror = "2" just_fmt = "0.1.2" memmap2 = "0.9" -sha2 = "0.10.8" +sha2 = "0.10" diff --git a/systems/sheet/src/sheet/reader.rs b/systems/sheet/src/sheet/reader.rs index 583e3b7..7a41bc1 100644 --- a/systems/sheet/src/sheet/reader.rs +++ b/systems/sheet/src/sheet/reader.rs @@ -1,5 +1,3 @@ -use constants::CURRENT_SHEET_VERSION; - use crate::{ mapping::{LocalMappingForward, Mapping}, sheet::{SheetData, error::ReadSheetDataError}, @@ -12,9 +10,9 @@ macro_rules! reader_do { let sheet_version = $full_sheet_data .first() .copied() - .unwrap_or(CURRENT_SHEET_VERSION); + .unwrap_or(crate::sheet::v1::constants::CURRENT_SHEET_VERSION); // CURRENT match sheet_version { - 1 => crate::sheet::v1::reader::$func($($arg),*), + 1 => crate::sheet::v1::reader::$func($($arg),*), // CURRENT _ => reader::$func($($arg),*), } }}; -- cgit