commit | 341b0a703f74f7128996a6a26a7ab350ff2cac4b | [log] [tgz] |
---|---|---|
author | Joel Galenson <jgalenson@google.com> | Wed Jul 01 07:06:32 2020 -0700 |
committer | Joel Galenson <jgalenson@google.com> | Wed Jul 01 07:06:32 2020 -0700 |
tree | c5933808e739b3235fbd8c064c3114755cd3e154 | |
parent | 5d73ec2453d18ea185ea21ee5c1da60537255775 [diff] |
Build for device. Test: Compile something using this and run it on device. Change-Id: I8e7f8a86689490691fa460cf4bab3c00ebf8929a
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.