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:
@@ -39,8 +39,11 @@ object = { version = "0.28", default-features = false, features = ['read_core',
|
||||
async-trait = { version = "0.1.51", optional = true }
|
||||
once_cell = "1.12"
|
||||
|
||||
[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_Diagnostics_Debug",
|
||||
]
|
||||
|
||||
[dev-dependencies]
|
||||
tempfile = "3.0"
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
//! available on Windows.
|
||||
|
||||
use crate::{AsContextMut, Store};
|
||||
use windows_sys::Win32::System::Diagnostics::Debug::EXCEPTION_POINTERS;
|
||||
|
||||
/// Extensions for the [`Store`] type only available on Windows.
|
||||
pub trait StoreExt {
|
||||
@@ -18,13 +19,13 @@ pub trait StoreExt {
|
||||
/// TODO: needs more documentation.
|
||||
unsafe fn set_signal_handler<H>(&mut self, handler: H)
|
||||
where
|
||||
H: 'static + Fn(winapi::um::winnt::PEXCEPTION_POINTERS) -> bool + Send + Sync;
|
||||
H: 'static + Fn(*mut EXCEPTION_POINTERS) -> bool + Send + Sync;
|
||||
}
|
||||
|
||||
impl<T> StoreExt for Store<T> {
|
||||
unsafe fn set_signal_handler<H>(&mut self, handler: H)
|
||||
where
|
||||
H: 'static + Fn(winapi::um::winnt::PEXCEPTION_POINTERS) -> bool + Send + Sync,
|
||||
H: 'static + Fn(*mut EXCEPTION_POINTERS) -> bool + Send + Sync,
|
||||
{
|
||||
self.as_context_mut()
|
||||
.0
|
||||
|
||||
Reference in New Issue
Block a user