X Tutup
Skip to content

Commit a22a8fc

Browse files
committed
Fix cfg
1 parent 6c2a8fc commit a22a8fc

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

crates/stdlib/src/multiprocessing.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff 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]
4647
mod _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]
485487
mod _multiprocessing {}

0 commit comments

Comments
 (0)
X Tutup