fix builds without ffi feature

This commit is contained in:
Skgland
2025-08-24 21:08:52 +02:00
committed by Bennet Bleßmann
parent 1f7a60dec9
commit 6f3f66c407
3 changed files with 251 additions and 188 deletions

View File

@@ -4302,62 +4302,50 @@ impl Machine {
step_or_fail!(self, self.machine_st.p = self.machine_st.cp);
}
&Instruction::CallLoadForeignLib => {
#[cfg(feature = "ffi")]
try_or_throw!(self.machine_st, self.load_foreign_lib());
step_or_fail!(self, self.machine_st.p += 1);
}
&Instruction::ExecuteLoadForeignLib => {
#[cfg(feature = "ffi")]
try_or_throw!(self.machine_st, self.load_foreign_lib());
step_or_fail!(self, self.machine_st.p = self.machine_st.cp);
}
&Instruction::CallForeignCall => {
#[cfg(feature = "ffi")]
try_or_throw!(self.machine_st, self.foreign_call());
step_or_fail!(self, self.machine_st.p += 1);
}
&Instruction::ExecuteForeignCall => {
#[cfg(feature = "ffi")]
try_or_throw!(self.machine_st, self.foreign_call());
step_or_fail!(self, self.machine_st.p = self.machine_st.cp);
}
&Instruction::CallDefineForeignStruct => {
#[cfg(feature = "ffi")]
try_or_throw!(self.machine_st, self.define_foreign_struct());
step_or_fail!(self, self.machine_st.p += 1);
}
&Instruction::ExecuteDefineForeignStruct => {
#[cfg(feature = "ffi")]
try_or_throw!(self.machine_st, self.define_foreign_struct());
step_or_fail!(self, self.machine_st.p = self.machine_st.cp);
}
&Instruction::CallFfiAllocate => {
#[cfg(feature = "ffi")]
try_or_throw!(self.machine_st, self.ffi_allocate());
step_or_fail!(self, self.machine_st.p += 1);
}
&Instruction::ExecuteFfiAllocate => {
#[cfg(feature = "ffi")]
try_or_throw!(self.machine_st, self.ffi_allocate());
step_or_fail!(self, self.machine_st.p = self.machine_st.cp);
}
&Instruction::CallFfiReadPtr => {
#[cfg(feature = "ffi")]
try_or_throw!(self.machine_st, self.ffi_read_ptr());
step_or_fail!(self, self.machine_st.p += 1);
}
&Instruction::ExecuteFfiReadPtr => {
#[cfg(feature = "ffi")]
try_or_throw!(self.machine_st, self.ffi_read_ptr());
step_or_fail!(self, self.machine_st.p = self.machine_st.cp);
}
&Instruction::CallFfiDeallocate => {
#[cfg(feature = "ffi")]
try_or_throw!(self.machine_st, self.ffi_deallocate());
step_or_fail!(self, self.machine_st.p += 1);
}
&Instruction::ExecuteFfiDeallocate => {
#[cfg(feature = "ffi")]
try_or_throw!(self.machine_st, self.ffi_deallocate());
step_or_fail!(self, self.machine_st.p = self.machine_st.cp);
}