yazi/yazi-macro/src/platform.rs
2025-01-03 08:18:34 +08:00

27 lines
284 B
Rust

#[macro_export]
macro_rules! unix_either {
($a:expr, $b:expr) => {{
#[cfg(unix)]
{
$a
}
#[cfg(not(unix))]
{
$b
}
}};
}
#[macro_export]
macro_rules! win_either {
($a:expr, $b:expr) => {{
#[cfg(windows)]
{
$a
}
#[cfg(not(windows))]
{
$b
}
}};
}