Skip to content

Commit

Permalink
Use raw-dylib for Windows futex APIs
Browse files Browse the repository at this point in the history
This is a workaround for older mingw `synchronization` import library not working on at least some system.
  • Loading branch information
ChrisDenton committed Apr 16, 2024
1 parent 4e1f5d9 commit f68529f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion library/std/src/sys/pal/windows/c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,19 @@ compat_fn_with_fallback! {
}

#[cfg(not(target_vendor = "win7"))]
#[link(name = "synchronization")]
// Use raw-dylib to import synchronization functions to workaround issues with the older mingw import library.
#[cfg_attr(
target_arch = "x86",
link(
name = "api-ms-win-core-synch-l1-2-0",
kind = "raw-dylib",
import_name_type = "undecorated"
)
)]
#[cfg_attr(
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,
Expand Down

0 comments on commit f68529f

Please sign in to comment.