1#[cfg_attr(not(target_os = "linux"), allow(unused))] mod small_c_string;
8#[cfg_attr(not(target_os = "windows"), allow(unused))] mod wstr;
10
11#[cfg(test)]
12mod tests;
13
14#[cfg_attr(not(target_os = "linux"), allow(unused))] pub use small_c_string::{run_path_with_cstr, run_with_cstr};
16#[cfg_attr(not(target_os = "windows"), allow(unused))] pub use wstr::WStrUnits;
18
19#[cfg_attr(not(target_os = "windows"), allow(unused))] pub fn mul_div_u64(value: u64, numerator: u64, denom: u64) -> u64 {
24 let q = value / denom;
25 let r = value % denom;
26 q * numerator + r * numerator / denom
30}
31
32#[cfg_attr(not(target_os = "linux"), allow(unused))] pub fn ignore_notfound<T>(result: crate::io::Result<T>) -> crate::io::Result<()> {
34 match result {
35 Err(err) if err.kind() == crate::io::ErrorKind::NotFound => Ok(()),
36 Ok(_) => Ok(()),
37 Err(err) => Err(err),
38 }
39}