commit | 4687d0da030c86a294c4e0b59f020b63394181a6 | [log] [tgz] |
---|---|---|
author | Joel Galenson <jgalenson@google.com> | Wed Jul 01 23:34:34 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Jul 01 23:34:34 2020 +0000 |
tree | c5933808e739b3235fbd8c064c3114755cd3e154 | |
parent | cc16def2aea338bc934f88227ef4401d9928b867 [diff] | |
parent | b78099a60cde3cf6d4c1e17ac6d1a5df91de6a12 [diff] |
Build for device. am: 341b0a703f am: bb9eaf9562 am: 79e9b14b73 am: 772daf2789 am: b78099a60c Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/cfg-if/+/1352891 Change-Id: I749709c45c1f66a9cd89dee604d7e6e68d2363e8
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.