tag | 7775e92c08eb480ba68357fdeb7fa168848e47cc | |
---|---|---|
tagger | The Android Open Source Project <initial-contribution@android.com> | Tue Apr 23 15:27:24 2024 -0700 |
object | 793fa6175fea740dbf651114ba68f5eced0c54c1 |
Platform Tools Release 35.0.1 (11580240)
commit | 793fa6175fea740dbf651114ba68f5eced0c54c1 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu Mar 07 02:14:02 2024 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu Mar 07 02:14:02 2024 +0000 |
tree | b4117d1e3f8b58573bac244c44693f9aaca78a18 | |
parent | e6fd501623a3f560995103925a631c01eb3c0d57 [diff] | |
parent | 758a07066edb271d71c48f21fc12d8af4c07b99d [diff] |
Snap for 11541002 from 758a07066edb271d71c48f21fc12d8af4c07b99d to sdk-release Change-Id: I91e49086668dcd39fc0bd6fe1566483dead95380
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.