commit | 496eec86a85f3374ee108aae0365232c72516594 | [log] [tgz] |
---|---|---|
author | Chih-Hung Hsieh <chh@google.com> | Tue May 12 19:49:49 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue May 12 19:49:49 2020 +0000 |
tree | 575cbebb0d6eb84d91709bae6e6020e843208906 | |
parent | 2dc946803bbb6824cbde2ef5a99f32e033d81174 [diff] | |
parent | 5d73ec2453d18ea185ea21ee5c1da60537255775 [diff] |
Add rust_test modules and TEST_MAPPING am: 7c69fd72f3 am: 5d73ec2453 Change-Id: I8c9f2b6207faebe11cc16feb615ccb339dbd3d1c
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.