commit | 4e70b0bd2ae4ab6e504dd21f087b3b0660a3c420 | [log] [tgz] |
---|---|---|
author | Chih-Hung Hsieh <chh@google.com> | Thu Oct 29 09:17:33 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu Oct 29 09:17:33 2020 +0000 |
tree | 7eaa4bb783161ce7406afa385147c033d47ef741 | |
parent | b29c9c2b08ea0961069b730ff3c22a15fbcc5647 [diff] | |
parent | b72d7218c0d90df5b0b08923edc480f222984f99 [diff] |
Upgrade rust/crates/cfg-if to 1.0.0 am: 70032b60de am: a4e6ae480a am: b72d7218c0 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/cfg-if/+/1474936 Change-Id: I26c4c919fd30185e1ce789cda52246f1c26b0956
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.