tag | 2f0dc6c9142b4e7d5660be3f27426a8dd68acc2a | |
---|---|---|
tagger | The Android Open Source Project <initial-contribution@android.com> | Fri Jun 19 16:31:13 2020 -0700 |
object | 662a9d14d2803536b073457142c79ac7e989db52 |
Platform Tools Release 30.0.3 (6597393)
commit | 662a9d14d2803536b073457142c79ac7e989db52 | [log] [tgz] |
---|---|---|
author | android-build-prod (mdb) <android-build-team-robot@google.com> | Wed May 27 20:48:20 2020 +0000 |
committer | android-build-prod (mdb) <android-build-team-robot@google.com> | Wed May 27 20:48:20 2020 +0000 |
tree | 575cbebb0d6eb84d91709bae6e6020e843208906 | |
parent | 7cef2ee290d47047f56c0003028788872aa7a2e6 [diff] | |
parent | 7c69fd72f36b27865f9722d433d51afc64a0ca18 [diff] |
Snap for 6533464 from 7c69fd72f36b27865f9722d433d51afc64a0ca18 to sdk-release Change-Id: Ifc75357673a186831e86d8a6b8e5cb2028c3d912
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.