File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,8 @@ mod _multiprocessing {
4141 }
4242}
4343
44- #[ cfg( unix) ]
44+ // Apple platforms don't support sem_timedwait/sem_getvalue in libc crate
45+ #[ cfg( all( unix, not( target_vendor = "apple" ) ) ) ]
4546#[ pymodule]
4647mod _multiprocessing {
4748 use crate :: vm:: {
@@ -57,10 +58,6 @@ mod _multiprocessing {
5758 sync:: atomic:: { AtomicU64 , AtomicUsize , Ordering } ,
5859 time:: Duration ,
5960 } ;
60- unsafe extern "C" {
61- fn sem_getvalue ( sem : * mut sem_t , sval : * mut libc:: c_int ) -> libc:: c_int ;
62- fn sem_timedwait ( sem : * mut sem_t , abs_timeout : * const libc:: timespec ) -> libc:: c_int ;
63- }
6461
6562 const RECURSIVE_MUTEX_KIND : i32 = 0 ;
6663 const SEMAPHORE_KIND : i32 = 1 ;
@@ -480,6 +477,11 @@ mod _multiprocessing {
480477 }
481478}
482479
480+ // Apple platforms (macOS, iOS, etc.) - empty module
481+ #[ cfg( all( unix, target_vendor = "apple" ) ) ]
482+ #[ pymodule]
483+ mod _multiprocessing { }
484+
483485#[ cfg( all( not( unix) , not( windows) ) ) ]
484486#[ pymodule]
485487mod _multiprocessing { }
You can’t perform that action at this time.
0 commit comments