commit | babc73a4a148fe30c4d65833e152c31cc68edf60 | [log] [tgz] |
---|---|---|
author | Jeff Vander Stoep <jeffv@google.com> | Thu Nov 05 17:07:02 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu Nov 05 17:07:02 2020 +0000 |
tree | eb1a804931306e5bdf9e61114225d3c00f1557f3 | |
parent | b72d7218c0d90df5b0b08923edc480f222984f99 [diff] | |
parent | 0cd662b3b5ca9bb3f1cef8018f7e4623a3c30baa [diff] |
TEST_MAPPING: test dependers of this crate am: 3d42651cb8 am: 0cd662b3b5 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/cfg-if/+/1488720 Change-Id: Ic974a3643c7392db9e9a742eb6db25c99304996a
A macro to ergonomically define an item depending on a large number of #[cfg] parameters. Structured like an if-else chain, the first matching branch is the item that gets emitted.
[dependencies] cfg-if = "0.1"
cfg_if::cfg_if! { if #[cfg(unix)] { fn foo() { /* unix specific functionality */ } } else if #[cfg(target_pointer_width = "32")] { fn foo() { /* non-unix, 32-bit functionality */ } } else { fn foo() { /* fallback implementation */ } } } fn main() { foo(); }
This project is licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in cfg-if
by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.