@@ -310,10 +310,10 @@ impl Thread {
310
310
target_os = "android" ,
311
311
target_os = "solaris" ,
312
312
target_os = "illumos" ,
313
- target_os = "macos " ,
314
- target_os = "ios " ,
315
- target_os = "tvos " ,
316
- target_os = "watchos "
313
+ target_os = "dragonfly " ,
314
+ target_os = "hurd " ,
315
+ target_os = "fuchsia " ,
316
+ target_vendor = "apple "
317
317
) ) ) ]
318
318
pub fn sleep_until ( deadline : Instant ) {
319
319
let now = Instant :: now ( ) ;
@@ -323,14 +323,17 @@ impl Thread {
323
323
}
324
324
}
325
325
326
- // Note depends on clock_nanosleep (not supported on macos/ios/watchos/tvos )
326
+ // Note depends on clock_nanosleep (not supported on os's by apple )
327
327
#[ cfg( any(
328
328
target_os = "freebsd" ,
329
329
target_os = "netbsd" ,
330
330
target_os = "linux" ,
331
331
target_os = "android" ,
332
332
target_os = "solaris" ,
333
333
target_os = "illumos" ,
334
+ target_os = "dragonfly" ,
335
+ target_os = "hurd" ,
336
+ target_os = "fuchsia" ,
334
337
) ) ]
335
338
pub fn sleep_until ( deadline : crate :: time:: Instant ) {
336
339
let mut ts = deadline
@@ -355,13 +358,7 @@ impl Thread {
355
358
}
356
359
}
357
360
358
- #[ cfg( any(
359
- target_os = "macos" ,
360
- target_os = "ios" ,
361
- target_os = "tvos" ,
362
- target_os = "watchos" ,
363
- target_os = "visionos"
364
- ) ) ]
361
+ #[ cfg( target_vendor = "apple" ) ]
365
362
pub fn sleep_until ( deadline : crate :: time:: Instant ) {
366
363
use core:: mem:: MaybeUninit ;
367
364
@@ -398,35 +395,17 @@ impl Thread {
398
395
}
399
396
}
400
397
401
- #[ cfg( any(
402
- target_os = "macos" ,
403
- target_os = "ios" ,
404
- target_os = "tvos" ,
405
- target_os = "watchos" ,
406
- target_os = "visionos"
407
- ) ) ]
398
+ #[ cfg( target_vendor = "apple" ) ]
408
399
const KERN_SUCCESS : libc:: c_int = 0 ;
409
400
410
- #[ cfg( any(
411
- target_os = "macos" ,
412
- target_os = "ios" ,
413
- target_os = "tvos" ,
414
- target_os = "watchos" ,
415
- target_os = "visionos"
416
- ) ) ]
401
+ #[ cfg( target_vendor = "apple" ) ]
417
402
#[ repr( C ) ]
418
403
struct mach_timebase_info_type {
419
404
numer : u32 ,
420
405
denom : u32 ,
421
406
}
422
407
423
- #[ cfg( any(
424
- target_os = "macos" ,
425
- target_os = "ios" ,
426
- target_os = "tvos" ,
427
- target_os = "watchos" ,
428
- target_os = "visionos"
429
- ) ) ]
408
+ #[ cfg( target_vendor = "apple" ) ]
430
409
extern "C" {
431
410
fn mach_wait_until ( deadline : u64 ) -> libc:: c_int ;
432
411
fn mach_timebase_info ( info : * mut mach_timebase_info_type ) -> libc:: c_int ;
0 commit comments