commit | bbc82691eb68322d38aed225d07d8dd842d9a65b | [log] [tgz] |
---|---|---|
author | Vikram Gaur <vikramgaur@google.com> | Fri Sep 23 11:18:38 2022 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Fri Sep 23 11:18:38 2022 +0000 |
tree | 1671303a1961bd03746c44c5c70ddf751f7dfb0c | |
parent | 06acf5fa28db211a14fd91aeeb3587b9b5dfd183 [diff] | |
parent | 9cb526f389154f8f11792f510961aa0ab9e6ff9a [diff] |
Open library to be added to any apex am: 57bc103bc9 am: 53fda8e320 am: 9cb526f389 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/cfg-if/+/2218628 Change-Id: I3623ec2bfb3e5fde3e78d5592e191223a7a9677b Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
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.