commit | 09b710d78237b0af9f8c9e87e28612aaefd333ec | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu Oct 28 17:29:38 2021 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu Oct 28 17:29:38 2021 +0000 |
tree | 45331511759b1dccee54302221197c3add21065e | |
parent | c0f2a57edf1ddbafb874053a6004891e992165d3 [diff] | |
parent | 823386b6946336dcb8718a10dc7eaf9cae68d864 [diff] |
Snap for 7862349 from 823386b6946336dcb8718a10dc7eaf9cae68d864 to t-keystone-qcom-release Change-Id: I0322367e8cb89ce608efd57c5f0020fe3e0b0f17
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.