tag | 7bf866bcd241f520cf4e105e0a8ff9f9f1bb2f83 | |
---|---|---|
tagger | The Android Open Source Project <initial-contribution@android.com> | Thu May 19 16:25:40 2022 -0700 |
object | dbdb8c391b2890b1c2adb0d904dd57815cd67f59 |
Platform Tools Release 33.0.1 (8253317)
commit | dbdb8c391b2890b1c2adb0d904dd57815cd67f59 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu Dec 23 02:03:53 2021 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu Dec 23 02:03:53 2021 +0000 |
tree | 7c1320cae66bd8625a65464d7080232c4d380447 | |
parent | c1b84b34fa01c0c2d2f9c664b199a6c76a36af75 [diff] | |
parent | 3a0379aa3da7a72be33132486b87df59254d6354 [diff] |
Snap for 8023979 from 3a0379aa3da7a72be33132486b87df59254d6354 to sdk-release Change-Id: I96ce5e6a50521e527400007251d75fefb2a847a6
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.