commit | bd92472097e5f17ab5a7866b6ff820578befdb65 | [log] [tgz] |
---|---|---|
author | Treehugger Robot <treehugger-gerrit@google.com> | Wed Jun 15 21:41:35 2022 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Jun 15 21:41:35 2022 +0000 |
tree | fa7c4e1b6e3e54e0298933de7d11ab4747a9883d | |
parent | eb1e73b6c6440704f1ab6203cf9c8c959df2aba9 [diff] | |
parent | f022aa62e0515b930753da1fbe2d6400cfc841d9 [diff] |
Merge changes from topic "test-mapping-06-14" am: c5d0141c5a am: abd9345402 am: f022aa62e0 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/cfg-if/+/2125757 Change-Id: Ia6275759dc0e1c466a1e5e96f1199039904f2a02 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
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.