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