commit | 6a308d81489f39794537632a6c4895aadecda4b3 | [log] [tgz] |
---|---|---|
author | Jeff Vander Stoep <jeffv@google.com> | Thu Nov 05 17:21:59 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu Nov 05 17:21:59 2020 +0000 |
tree | eb1a804931306e5bdf9e61114225d3c00f1557f3 | |
parent | 4e70b0bd2ae4ab6e504dd21f087b3b0660a3c420 [diff] | |
parent | babc73a4a148fe30c4d65833e152c31cc68edf60 [diff] |
TEST_MAPPING: test dependers of this crate am: 3d42651cb8 am: 0cd662b3b5 am: babc73a4a1 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/cfg-if/+/1488720 Change-Id: Ibeecc9115a054d27f7e8d3ca5f0690397c66dbf4
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.