From 0e8c347b00d9b2f9888deb86de28f6cf17ddb9bb Mon Sep 17 00:00:00 2001 From: Benedikt Spies Date: Tue, 17 May 2022 19:27:07 +0200 Subject: [PATCH] Add WASI support --- src/lib.rs | 2 +- src/system.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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;