1#[cfg_attr(not(target_os = "netbsd"), allow(unused))] mod c_opaque;
8#[cfg_attr(not(target_os = "linux"), allow(unused))] mod small_c_string;
10#[cfg_attr(not(target_os = "windows"), allow(unused))] mod wstr;
12
13#[cfg(test)]
14mod tests;
15
16#[cfg_attr(not(target_os = "netbsd"), allow(unused))] pub use c_opaque::COpaque;
18#[cfg_attr(not(target_os = "linux"), allow(unused))] pub use small_c_string::{run_path_with_cstr, run_with_cstr};
20#[cfg_attr(not(target_os = "windows"), allow(unused))] pub use wstr::WStrUnits;
22
23#[cfg_attr(not(target_os = "windows"), allow(unused))] pub fn mul_div_u64(value: u64, numerator: u64, denom: u64) -> u64 {
28 let q = value / denom;
29 let r = value % denom;
30 q * numerator + r * numerator / denom
34}
35
36#[cfg_attr(not(target_os = "linux"), allow(unused))] pub fn ignore_notfound<T>(result: crate::io::Result<T>) -> crate::io::Result<()> {
38 match result {
39 Err(err) if err.kind() == crate::io::ErrorKind::NotFound => Ok(()),
40 Ok(_) => Ok(()),
41 Err(err) => Err(err),
42 }
43}