commit | 70032b60de54fe64f776013672f4c2b8de2a8caf | [log] [tgz] |
---|---|---|
author | Chih-Hung Hsieh <chh@google.com> | Mon Oct 26 13:16:41 2020 -0700 |
committer | Chih-Hung Hsieh <chh@google.com> | Mon Oct 26 16:48:28 2020 -0700 |
tree | 7eaa4bb783161ce7406afa385147c033d47ef741 | |
parent | b8af5d6fc65fce49b6aa5f93e7d0ec3f0ab90f3d [diff] |
Upgrade rust/crates/cfg-if to 1.0.0 * Add missing patches/std.diff, which is needed by external_updater Test: make Test: tools/external_updater/updater.sh update --refresh --keep_date rust/crates/cfg-if Change-Id: Ibebd1c383855d62a2b9bc246c81be48554586c7a
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.