#[cfg(unix)]
mod imp {
use core::sync::atomic::AtomicI32;
pub(crate) use std::os::fd::OwnedFd as Owned;
pub(crate) use std::os::fd::OwnedFd as OwnedFile;
pub(crate) use std::os::fd::RawFd as Raw;
pub(crate) fn file_raw(file: &OwnedFile) -> Raw {
use std::os::fd::AsRawFd;
file.as_raw_fd()
}
pub(crate) type AtomicRaw = AtomicI32;
pub(crate) const NONE: Raw = -1;
}
#[cfg(windows)]
mod imp {
use core::sync::atomic::AtomicU64;
pub(crate) use std::os::windows::io::OwnedHandle as OwnedFile;
pub(crate) use std::os::windows::io::OwnedSocket as Owned;
pub(crate) fn file_raw(file: &OwnedFile) -> Raw {
use std::os::windows::io::AsRawHandle;
file.as_raw_handle() as usize as Raw
}
pub(crate) type Raw = u64;
pub(crate) type AtomicRaw = AtomicU64;
pub(crate) const NONE: Raw = u64::MAX;
}
pub(crate) use imp::*;