commit | e044699ebc7b203f33f66eeef6e8f40bc6d85046 | [log] [tgz] |
---|---|---|
author | Bill Rassieur <rassb@google.com> | Thu May 27 20:03:00 2021 +0000 |
committer | Bill Rassieur <rassb@google.com> | Thu May 27 20:03:00 2021 +0000 |
tree | e92f4fe177a0e5de1592173245d3d3c23cd3b9fb | |
parent | d91fb3a2677b1c19a57c62fefb62510581e98c3d [diff] | |
parent | 8d895366089df6377d66967371f86ece5197c720 [diff] |
Merge sc-mainline-prod to master. Change-Id: I5db80c86d369470c31ea3c77de038d8289279b99
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.