cfg_if::cfg_if! {
if #[cfg(target_arch = "aarch64")] {
mod aarch64;
pub(crate) use supported::*;
} else if #[cfg(target_arch = "x86_64")] {
mod x86_64;
pub(crate) use supported::*;
} else if #[cfg(target_arch = "x86")] {
mod x86;
pub(crate) use supported::*;
} else if #[cfg(target_arch = "arm")] {
mod arm;
pub(crate) use supported::*;
} else if #[cfg(target_arch = "s390x")] {
pub(crate) use supported::*;
} else if #[cfg(target_arch = "riscv64")] {
mod riscv64;
pub(crate) use supported::*;
} else {
pub(crate) use unsupported::*;
}
}
#[allow(
dead_code,
reason = "expected to have dead code in some configurations"
)]
mod supported {
pub const SUPPORTED_ARCH: bool = true;
unsafe extern "C" {
#[wasmtime_versioned_export_macros::versioned_link]
pub(crate) fn wasmtime_fiber_init(
top_of_stack: *mut u8,
entry: extern "C" fn(*mut u8, *mut u8),
entry_arg0: *mut u8,
);
#[wasmtime_versioned_export_macros::versioned_link]
pub(crate) fn wasmtime_fiber_switch(top_of_stack: *mut u8);
#[wasmtime_versioned_export_macros::versioned_link]
pub(crate) fn wasmtime_fiber_start();
}
}
#[allow(
dead_code,
reason = "expected to have dead code in some configurations"
)]
mod unsupported {
pub const SUPPORTED_ARCH: bool = false;
pub(crate) unsafe fn wasmtime_fiber_init(
_top_of_stack: *mut u8,
_entry: extern "C" fn(*mut u8, *mut u8),
_entry_arg0: *mut u8,
) {
unreachable!();
}
pub(crate) unsafe fn wasmtime_fiber_switch(_top_of_stack: *mut u8) {
unreachable!();
}
}