Skip to content

Commit

Permalink
Cranelift: Revert raw-dylib for Windows futex APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisDenton committed Apr 16, 2024
1 parent e3078f8 commit 5448070
Showing 1 changed file with 63 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
From 231e20fe3e14a38fbb99c3175e2c130cf5be9967 Mon Sep 17 00:00:00 2001
From: Chris Denton <chris@chrisdenton.dev>
Date: Tue, 16 Apr 2024 14:34:28 +0000
Subject: [PATCH] Revert use raw-dylib for Windows futex APIs

---
library/std/src/sys/pal/windows/c.rs | 40 +++++++++-------------------
1 file changed, 12 insertions(+), 28 deletions(-)

diff --git a/library/std/src/sys/pal/windows/c.rs b/library/std/src/sys/pal/windows/c.rs
index 503fada6a46..1c828bac4b6 100644
--- a/library/std/src/sys/pal/windows/c.rs
+++ b/library/std/src/sys/pal/windows/c.rs
@@ -356,34 +356,18 @@ pub fn GetTempPath2W(bufferlength: u32, buffer: PWSTR) -> u32 {
}
}

-// Use raw-dylib to import synchronization functions to workaround issues with the older mingw import library.
-cfg_if::cfg_if! {
-if #[cfg(not(target_vendor = "win7"))] {
- #[cfg(target_arch = "x86")]
- #[link(name = "api-ms-win-core-synch-l1-2-0", kind = "raw-dylib", import_name_type = "undecorated")]
- extern "system" {
- pub fn WaitOnAddress(
- address: *const c_void,
- compareaddress: *const c_void,
- addresssize: usize,
- dwmilliseconds: u32,
- ) -> BOOL;
- pub fn WakeByAddressSingle(address: *const c_void);
- pub fn WakeByAddressAll(address: *const c_void);
- }
- #[cfg(not(target_arch = "x86"))]
- #[link(name = "api-ms-win-core-synch-l1-2-0", kind = "raw-dylib")]
- extern "system" {
- pub fn WaitOnAddress(
- address: *const c_void,
- compareaddress: *const c_void,
- addresssize: usize,
- dwmilliseconds: u32,
- ) -> BOOL;
- pub fn WakeByAddressSingle(address: *const c_void);
- pub fn WakeByAddressAll(address: *const c_void);
- }
-}}
+#[cfg(not(target_vendor = "win7"))]
+#[link(name = "synchronization")]
+extern "system" {
+ pub fn WaitOnAddress(
+ address: *const c_void,
+ compareaddress: *const c_void,
+ addresssize: usize,
+ dwmilliseconds: u32,
+ ) -> BOOL;
+ pub fn WakeByAddressSingle(address: *const c_void);
+ pub fn WakeByAddressAll(address: *const c_void);
+}

#[cfg(target_vendor = "win7")]
compat_fn_optional! {
--
2.42.0.windows.2

0 comments on commit 5448070

Please sign in to comment.