use super::host; use cfg_if::cfg_if; cfg_if! { if #[cfg(unix)] { mod unix; pub use self::unix::*; pub fn errno_from_host(err: i32) -> host::__wasi_errno_t { host_impl::errno_from_nix(nix::errno::from_i32(err)) } } else if #[cfg(windows)] { mod windows; pub use self::windows::*; pub fn errno_from_host(err: i32) -> host::__wasi_errno_t { host_impl::errno_from_win(winx::winerror::WinError::from_u32(err as u32)) } } else { compile_error!("wasi-common doesn't compile for this platform yet"); } }