commit | 3ebea032a3afdfe6d54f4b34d49569c4db33910c | [log] [tgz] |
---|---|---|
author | James Farrell <jamesfarrell@google.com> | Thu Aug 15 01:50:59 2024 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu Aug 15 01:50:59 2024 +0000 |
tree | 1ee36a19abf2c98eb4597245c6198d7b3ccb919b | |
parent | d4d5d9f2b2b1c50a9db57d2d3e5a10b7e17ab814 [diff] | |
parent | 7da52636420b6747f57298341a41ff86813508f3 [diff] |
Migrate 25 crates to monorepo am: 7da5263642 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/cfg-if/+/3218111 Change-Id: I2b6dd9570e12e6b2b7d5683d30adeb483579b76a 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.