diff options
author | Joel Galenson <jgalenson@google.com> | 2021-08-09 10:33:23 -0700 |
---|---|---|
committer | Joel Galenson <jgalenson@google.com> | 2021-08-09 10:33:23 -0700 |
commit | 0228b9e3fe227b08a1c43e7a6b712ea405a17e8c (patch) | |
tree | 6497382f249fbcdca1698acf20570e87816cea15 | |
parent | 04bd053b28a4d14ba1ea20ca455df3d843282165 (diff) | |
download | instant-0228b9e3fe227b08a1c43e7a6b712ea405a17e8c.tar.gz |
Upgrade rust/crates/instant to 0.1.10
Test: make
Change-Id: I9fea83cf980dd876681e3df3b076e1ffd6aafa96
-rw-r--r-- | .cargo_vcs_info.json | 2 | ||||
-rw-r--r-- | Android.bp | 1 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | Cargo.toml.orig | 2 | ||||
-rw-r--r-- | METADATA | 10 | ||||
-rw-r--r-- | src/wasm.rs | 8 |
6 files changed, 16 insertions, 9 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index 0fa03ad..56bc629 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json @@ -1,5 +1,5 @@ { "git": { - "sha1": "eff71cffcc21f0b6d84a7dc3009cacb9ff16b4ea" + "sha1": "1f72ffddf0dbc4e6905d8543d113324d6967e038" } } @@ -1,4 +1,5 @@ // This file is generated by cargo2android.py --run --device --dependencies. +// Do not modify this file as changes will be overridden on upgrade. package { default_applicable_licenses: ["external_rust_crates_instant_license"], @@ -13,7 +13,7 @@ [package] edition = "2018" name = "instant" -version = "0.1.9" +version = "0.1.10" authors = ["sebcrozet <developer@crozet.re>"] description = "A partial replacement for std::time::Instant that works on WASM too." readme = "README.md" diff --git a/Cargo.toml.orig b/Cargo.toml.orig index f6be57f..7cd1dc4 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -1,6 +1,6 @@ [package] name = "instant" -version = "0.1.9" +version = "0.1.10" authors = ["sebcrozet <developer@crozet.re>"] description = "A partial replacement for std::time::Instant that works on WASM too." repository = "https://github.com/sebcrozet/instant" @@ -7,13 +7,13 @@ third_party { } url { type: ARCHIVE - value: "https://static.crates.io/crates/instant/instant-0.1.9.crate" + value: "https://static.crates.io/crates/instant/instant-0.1.10.crate" } - version: "0.1.9" + version: "0.1.10" license_type: NOTICE last_upgrade_date { - year: 2020 - month: 11 - day: 19 + year: 2021 + month: 8 + day: 9 } } diff --git a/src/wasm.rs b/src/wasm.rs index 986bbf6..57ea39c 100644 --- a/src/wasm.rs +++ b/src/wasm.rs @@ -128,11 +128,17 @@ pub fn now() -> f64 { #[cfg(not(any(feature = "wasm-bindgen", feature = "stdweb")))] mod js { extern "C" { + #[cfg(not(target_os = "emscripten"))] pub fn now() -> f64; + #[cfg(target_os = "emscripten")] + pub fn _emscripten_get_now() -> f64; } } // Make the unsafe extern function "safe" so it can be called like the other 'now' functions #[cfg(not(any(feature = "wasm-bindgen", feature = "stdweb")))] pub fn now() -> f64 { - unsafe { js::now() } + #[cfg(not(target_os = "emscripten"))] + return unsafe { js::now() }; + #[cfg(target_os = "emscripten")] + return unsafe { js::_emscripten_get_now() }; } |