Skip to content

Commit

Permalink
wrap call in unsafe, unconditionally depend on winapi
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark McCaskey committed May 21, 2019
1 parent 736bddf commit 2a30fc3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/wasi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ log = "0.4.6"
byteorder = "1.3.1"
# hack to get tests to work
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.4.2", optional = true }
winapi = { version = "0.3.7", optional = true }
winapi = "0.3"

[build-dependencies]
glob = "0.2.11"
Expand Down
2 changes: 1 addition & 1 deletion lib/wasi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#[macro_use]
extern crate log;
#[cfg(target = windows)]
#[cfg(target = "windows")]
extern crate winapi;

#[macro_use]
Expand Down
2 changes: 1 addition & 1 deletion lib/wasi/src/syscalls/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub fn platform_clock_time_get(
) -> __wasi_errno_t {
let nanos = match clock_id {
__WASI_CLOCK_MONOTONIC => {
let tick_ms = winapi::um::sysinfoapi::GetTickCount64();
let tick_ms = unsafe { winapi::um::sysinfoapi::GetTickCount64() };
tick_ms * 1_000_000
}
__WASI_CLOCK_REALTIME => {
Expand Down

0 comments on commit 2a30fc3

Please sign in to comment.