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