commit | b29c9c2b08ea0961069b730ff3c22a15fbcc5647 | [log] [tgz] |
---|---|---|
author | Xin Li <delphij@google.com> | Fri Oct 09 03:22:59 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Fri Oct 09 03:22:59 2020 +0000 |
tree | 9f53b461009a2611d3ee163fd22cd03401f946fa | |
parent | f5eb3a2f3ec96d710e631b80abd91c8e137b0345 [diff] | |
parent | f735f295dc8dfab1c2ab8c28346d51baad7a4a11 [diff] |
[automerger skipped] Skip ab/6749736 in stage. am: b8af5d6fc6 -s ours am: f735f295dc -s ours am skip reason: Change-Id I85955ea022870392a28a1e14613b84f589cd5094 with SHA-1 c946b00980 is in history Original change: https://googleplex-android-review.googlesource.com/c/platform/external/rust/crates/cfg-if/+/12797377 Change-Id: I41a462c6f12023fc31fecea879e4792745542849
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.