diff --git a/src/lib.rs b/src/lib.rs index 8a95877..b389693 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,7 +9,7 @@ #[cfg(feature="format")] extern crate pad; #[cfg(feature="parse")] extern crate iso8601; -#[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "redox")))] +#[cfg(all(any(unix, target_os = "wasi"), not(target_os = "macos"), not(target_os = "ios"), not(target_os = "redox")))] extern crate libc; // used in the system module #[cfg(windows)] extern crate winapi; diff --git a/src/system.rs b/src/system.rs index f69a4aa..8fb6ffd 100644 --- a/src/system.rs +++ b/src/system.rs @@ -16,7 +16,7 @@ extern { fn gettimeofday(tp: *mut libc::timeval, tzp: *mut libc::timezone) -> libc::c_int; } -#[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "redox")))] +#[cfg(all(any(unix, target_os = "wasi"), not(target_os = "macos"), not(target_os = "ios"), not(target_os = "redox")))] use libc::clock_gettime;