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