macro_rules! feature {
(if ($name:literal) { $then1:expr } else $(if $condition:tt { $then2:expr } else)* { $else:expr }) => { ... };
(if (!$name:literal) { $then1:expr } else $(if $condition:tt { $then2:expr } else)* { $else:expr }) => { ... };
({ $else:expr }) => { ... };
}Expand description
Compiles expressions conditionally on features.
ยงExamples
use cfg_exif::expr::feature;
assert_eq!(
feature!(if ("foo") {
0
} else if (!"bar") {
42
} else {
1
}),
42
);