1#![no_std]
24#![warn(missing_docs)]
25#![cfg_attr(feature = "cargo-clippy", allow(clippy::style))]
26
27#[cold]
28#[inline(never)]
29fn unlikely<T>(result: T) -> T {
30 result
31}
32
33#[cfg(not(any(windows, unix, target_os = "fuchsia")))]
34compile_error!("Semaphore is not available for your target");
35
36#[cfg(any(all(unix, not(any(target_os = "macos", target_os = "ios"))), target_os = "fuchsia"))]
37mod posix;
38#[cfg(any(all(unix, not(any(target_os = "macos", target_os = "ios"))), target_os = "fuchsia"))]
39pub use posix::Sem;
40
41#[cfg(windows)]
42mod win32;
43#[cfg(windows)]
44pub use win32::Sem;
45
46#[cfg(any(target_os = "macos", target_os = "ios"))]
47mod mac;
48#[cfg(any(target_os = "macos", target_os = "ios"))]
49pub use mac::Sem;