mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-20 20:26:32 +00:00
wrap call in unsafe, unconditionally depend on winapi
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -2492,6 +2492,7 @@ dependencies = [
|
|||||||
"wasmer-dev-utils 0.4.2",
|
"wasmer-dev-utils 0.4.2",
|
||||||
"wasmer-runtime-core 0.4.2",
|
"wasmer-runtime-core 0.4.2",
|
||||||
"wasmer-singlepass-backend 0.4.2",
|
"wasmer-singlepass-backend 0.4.2",
|
||||||
|
"winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -19,7 +19,7 @@ log = "0.4.6"
|
|||||||
byteorder = "1.3.1"
|
byteorder = "1.3.1"
|
||||||
# hack to get tests to work
|
# hack to get tests to work
|
||||||
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.4.2", optional = true }
|
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.4.2", optional = true }
|
||||||
winapi = { version = "0.3.7", optional = true }
|
winapi = "0.3"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
glob = "0.2.11"
|
glob = "0.2.11"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate log;
|
extern crate log;
|
||||||
#[cfg(target = windows)]
|
#[cfg(target = "windows")]
|
||||||
extern crate winapi;
|
extern crate winapi;
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
@ -29,7 +29,7 @@ pub fn platform_clock_time_get(
|
|||||||
) -> __wasi_errno_t {
|
) -> __wasi_errno_t {
|
||||||
let nanos = match clock_id {
|
let nanos = match clock_id {
|
||||||
__WASI_CLOCK_MONOTONIC => {
|
__WASI_CLOCK_MONOTONIC => {
|
||||||
let tick_ms = winapi::um::sysinfoapi::GetTickCount64();
|
let tick_ms = unsafe { winapi::um::sysinfoapi::GetTickCount64() };
|
||||||
tick_ms * 1_000_000
|
tick_ms * 1_000_000
|
||||||
}
|
}
|
||||||
__WASI_CLOCK_REALTIME => {
|
__WASI_CLOCK_REALTIME => {
|
||||||
|
Reference in New Issue
Block a user