@@ -356,18 +356,34 @@ compat_fn_with_fallback! {
356
356
}
357
357
}
358
358
359
- #[ cfg( not( target_vendor = "win7" ) ) ]
360
- #[ link( name = "synchronization" ) ]
361
- extern "system" {
362
- pub fn WaitOnAddress (
363
- address : * const c_void ,
364
- compareaddress : * const c_void ,
365
- addresssize : usize ,
366
- dwmilliseconds : u32 ,
367
- ) -> BOOL ;
368
- pub fn WakeByAddressSingle ( address : * const c_void ) ;
369
- pub fn WakeByAddressAll ( address : * const c_void ) ;
370
- }
359
+ // Use raw-dylib to import synchronization functions to workaround issues with the older mingw import library.
360
+ cfg_if:: cfg_if! {
361
+ if #[ cfg( not( target_vendor = "win7" ) ) ] {
362
+ #[ cfg( target_arch = "x86" ) ]
363
+ #[ link( name = "api-ms-win-core-synch-l1-2-0" , kind = "raw-dylib" , import_name_type = "undecorated" ) ]
364
+ extern "system" {
365
+ pub fn WaitOnAddress (
366
+ address: * const c_void,
367
+ compareaddress: * const c_void,
368
+ addresssize: usize ,
369
+ dwmilliseconds: u32 ,
370
+ ) -> BOOL ;
371
+ pub fn WakeByAddressSingle ( address: * const c_void) ;
372
+ pub fn WakeByAddressAll ( address: * const c_void) ;
373
+ }
374
+ #[ cfg( not( target_arch = "x86" ) ) ]
375
+ #[ link( name = "api-ms-win-core-synch-l1-2-0" , kind = "raw-dylib" ) ]
376
+ extern "system" {
377
+ pub fn WaitOnAddress (
378
+ address: * const c_void,
379
+ compareaddress: * const c_void,
380
+ addresssize: usize ,
381
+ dwmilliseconds: u32 ,
382
+ ) -> BOOL ;
383
+ pub fn WakeByAddressSingle ( address: * const c_void) ;
384
+ pub fn WakeByAddressAll ( address: * const c_void) ;
385
+ }
386
+ } }
371
387
372
388
#[ cfg( target_vendor = "win7" ) ]
373
389
compat_fn_optional ! {
0 commit comments