Skip to content

Commit 148ecb4

Browse files
committed
Use raw-dylib for Windows futex APIs
This is a workaround for older mingw `synchronization` import library not working on at least some system.
1 parent 4e1f5d9 commit 148ecb4

File tree

1 file changed

+3
-1
lines changed
  • library/std/src/sys/pal/windows

1 file changed

+3
-1
lines changed

library/std/src/sys/pal/windows/c.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,9 @@ compat_fn_with_fallback! {
357357
}
358358

359359
#[cfg(not(target_vendor = "win7"))]
360-
#[link(name = "synchronization")]
360+
// Use raw-dylib to import synchronization functions to workaround issues with the older mingw import library.
361+
#[cfg_attr(target_arch = "x86", link(name = "api-ms-win-core-synch-l1-2-0", kind = "raw-dylib", import_name_type = "undecorated"))]
362+
#[cfg_attr(not(target_arch = "x86"), link(name = "api-ms-win-core-synch-l1-2-0", kind = "raw-dylib"))]
361363
extern "system" {
362364
pub fn WaitOnAddress(
363365
address: *const c_void,

0 commit comments

Comments
 (0)