commit | 131f8b0c52168c5e5267d2b4625db2599d1d3ca3 | [log] [tgz] |
---|---|---|
author | Vikram Gaur <vikramgaur@google.com> | Fri Sep 23 12:01:17 2022 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Fri Sep 23 12:01:17 2022 +0000 |
tree | 1671303a1961bd03746c44c5c70ddf751f7dfb0c | |
parent | 01959903ac3ed33edb5fdb708588635ac33a8ee0 [diff] | |
parent | bbc82691eb68322d38aed225d07d8dd842d9a65b [diff] |
Open library to be added to any apex am: 57bc103bc9 am: 53fda8e320 am: 9cb526f389 am: bbc82691eb Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/cfg-if/+/2218628 Change-Id: I3bcb980fc79da31c25df9c2007bb0182ae2db23e 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.