tag | b5313003b897d4c167784b4fa11a59d6666eff24 | |
---|---|---|
tagger | The Android Open Source Project <initial-contribution@android.com> | Thu Aug 06 12:28:31 2020 -0700 |
object | d91f36e7992c321a0d90183e380c170f3fc0f860 |
Android R Beta 3
commit | d91f36e7992c321a0d90183e380c170f3fc0f860 | [log] [tgz] |
---|---|---|
author | Matthew Maurer <mmaurer@google.com> | Mon Jul 06 13:14:54 2020 -0700 |
committer | Matthew Maurer <mmaurer@google.com> | Mon Jul 06 13:14:54 2020 -0700 |
tree | d585bdf233225a882a5b55ddb7b8cc40fe0d7589 | |
parent | 341b0a703f74f7128996a6a26a7ab350ff2cac4b [diff] |
Support building all variants. Bug: 143217452 Test: cd external/rust; mma; atest in all TEST_MAPPING subdirs Change-Id: I4cf46754f6224d60303794158db966ad1b3de271
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.