commit | f94b78cbe868ad98000d583a02b6db1283e78bd1 | [log] [tgz] |
---|---|---|
author | Xin Li <delphij@google.com> | Tue Nov 24 02:03:17 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Nov 24 02:03:17 2020 +0000 |
tree | eb1a804931306e5bdf9e61114225d3c00f1557f3 | |
parent | 6a308d81489f39794537632a6c4895aadecda4b3 [diff] | |
parent | 8fcc90ed7b0b321c58bd5cfc423ddf47a858f38b [diff] |
Mark ab/6881855 as merged am: 8fcc90ed7b Original change: https://googleplex-android-review.googlesource.com/c/platform/external/rust/crates/cfg-if/+/13112769 Change-Id: Ied6aa13b4e4af13f4422eaca7ec08ca53559b3aa
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.