Migrate from winapi to windows-sys (#4346)
* Migrate from `winapi` to `windows-sys` I believe that Microsoft itself is supporting the development of `windows-sys` and it's also used by `cap-std` now so this switches Wasmtime's dependencies on Windows APIs from the `winapi` crate to the `windows-sys` crate. We still have `winapi` in our dependency graph but that may get phased out over time. * Make windows-sys a target-specific dependency
This commit is contained in:
7
crates/cache/Cargo.toml
vendored
7
crates/cache/Cargo.toml
vendored
@@ -20,8 +20,11 @@ sha2 = "0.9.0"
|
||||
toml = "0.5.5"
|
||||
zstd = { version = "0.11.1", default-features = false }
|
||||
|
||||
[target.'cfg(target_os = "windows")'.dependencies]
|
||||
winapi = "0.3.7"
|
||||
[target.'cfg(target_os = "windows")'.dependencies.windows-sys]
|
||||
version = "0.36.0"
|
||||
features = [
|
||||
"Win32_System_Threading",
|
||||
]
|
||||
|
||||
[target.'cfg(not(target_os = "windows"))'.dependencies]
|
||||
rustix = { version = "0.35.6", features = ["process"] }
|
||||
|
||||
3
crates/cache/src/worker.rs
vendored
3
crates/cache/src/worker.rs
vendored
@@ -230,8 +230,7 @@ impl WorkerThread {
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
fn lower_thread_priority() {
|
||||
use winapi::um::processthreadsapi::{GetCurrentThread, SetThreadPriority};
|
||||
use winapi::um::winbase::THREAD_MODE_BACKGROUND_BEGIN;
|
||||
use windows_sys::Win32::System::Threading::*;
|
||||
|
||||
// https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-setthreadpriority
|
||||
// https://docs.microsoft.com/en-us/windows/win32/procthread/scheduling-priorities
|
||||
|
||||
Reference in New Issue
Block a user