mirror of
https://github.com/fluencelabs/wasm-timer
synced 2025-03-15 00:00:49 +00:00
Don't use wasm-bindgen on wasi
This commit is contained in:
parent
366b800318
commit
10a791e323
@ -2,7 +2,7 @@
|
||||
name = "wasm-timer"
|
||||
edition = "2018"
|
||||
description = "Abstraction over std::time::Instant and futures-timer that works on WASM"
|
||||
version = "0.2.1"
|
||||
version = "0.2.2"
|
||||
authors = ["Pierre Krieger <pierre.krieger1708@gmail.com>"]
|
||||
license = "MIT"
|
||||
repository = "https://github.com/tomaka/wasm-timer"
|
||||
@ -12,7 +12,7 @@ futures-preview = "0.3.0-alpha"
|
||||
parking_lot = "0.9"
|
||||
pin-utils = "0.1.0-alpha.4"
|
||||
|
||||
[target.'cfg(any(target_arch = "wasm32"))'.dependencies]
|
||||
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
|
||||
js-sys = "0.3.14"
|
||||
send_wrapper = "0.2"
|
||||
wasm-bindgen = { version = "0.2.37" }
|
||||
|
@ -20,11 +20,11 @@
|
||||
|
||||
pub use timer::*;
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
|
||||
pub use std::time::{Instant, SystemTime, UNIX_EPOCH};
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
pub use wasm::*;
|
||||
|
||||
mod timer;
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
mod wasm;
|
||||
|
@ -537,7 +537,7 @@ impl TimerHandle {
|
||||
}
|
||||
|
||||
impl Default for TimerHandle {
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
|
||||
fn default() -> TimerHandle {
|
||||
let mut fallback = HANDLE_FALLBACK.load(SeqCst);
|
||||
|
||||
@ -579,7 +579,7 @@ impl Default for TimerHandle {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
fn default() -> TimerHandle {
|
||||
let mut fallback = HANDLE_FALLBACK.load(SeqCst);
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
pub(crate) use self::platform::*;
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
|
||||
#[path = "global/desktop.rs"]
|
||||
mod platform;
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
#[path = "global/wasm.rs"]
|
||||
mod platform;
|
||||
|
@ -19,7 +19,7 @@
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
#![cfg(target_arch = "wasm32")]
|
||||
#![cfg(all(target_arch = "wasm32", target_os = "unknown"))]
|
||||
|
||||
use std::cmp::{Eq, PartialEq, Ord, PartialOrd, Ordering};
|
||||
use std::ops::{Add, Sub, AddAssign, SubAssign};
|
||||
|
Loading…
x
Reference in New Issue
Block a user