fix new compilation errors in haku-wasm

This commit is contained in:
りき萌 2025-09-01 17:17:54 +02:00
parent bc2df73487
commit 40038d3fdc

View file

@ -496,22 +496,24 @@ unsafe extern "C" fn haku_num_diagnostics(instance: *const Instance) -> u32 {
#[unsafe(no_mangle)] #[unsafe(no_mangle)]
unsafe extern "C" fn haku_diagnostic_start(instance: *const Instance, index: u32) -> u32 { unsafe extern "C" fn haku_diagnostic_start(instance: *const Instance, index: u32) -> u32 {
(*instance).diagnostics2[index as usize].span().start (&(*instance).diagnostics2)[index as usize].span().start
} }
#[unsafe(no_mangle)] #[unsafe(no_mangle)]
unsafe extern "C" fn haku_diagnostic_end(instance: *const Instance, index: u32) -> u32 { unsafe extern "C" fn haku_diagnostic_end(instance: *const Instance, index: u32) -> u32 {
(*instance).diagnostics2[index as usize].span().end (&(*instance).diagnostics2)[index as usize].span().end
} }
#[unsafe(no_mangle)] #[unsafe(no_mangle)]
unsafe extern "C" fn haku_diagnostic_message(instance: *const Instance, index: u32) -> *const u8 { unsafe extern "C" fn haku_diagnostic_message(instance: *const Instance, index: u32) -> *const u8 {
(*instance).diagnostics2[index as usize].message().as_ptr() (&(*instance).diagnostics2)[index as usize]
.message()
.as_ptr()
} }
#[unsafe(no_mangle)] #[unsafe(no_mangle)]
unsafe extern "C" fn haku_diagnostic_message_len(instance: *const Instance, index: u32) -> u32 { unsafe extern "C" fn haku_diagnostic_message_len(instance: *const Instance, index: u32) -> u32 {
(*instance).diagnostics2[index as usize].message().len() as u32 (&(*instance).diagnostics2)[index as usize].message().len() as u32
} }
#[unsafe(no_mangle)] #[unsafe(no_mangle)]