commit | cc16def2aea338bc934f88227ef4401d9928b867 | [log] [tgz] |
---|---|---|
author | Chih-Hung Hsieh <chh@google.com> | Tue May 12 21:13:54 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue May 12 21:13:54 2020 +0000 |
tree | 575cbebb0d6eb84d91709bae6e6020e843208906 | |
parent | 100cb3a0e4857e9a0c164b6465ed5bd6651c4946 [diff] | |
parent | b9905ae272db710a01d0dc2c37431a074ae69add [diff] |
Add rust_test modules and TEST_MAPPING am: 7c69fd72f3 am: 5d73ec2453 am: 496eec86a8 am: 27a62b89ca am: b9905ae272 Change-Id: I01e782f0fceeea45e398c1f16dd77c77c689aec6
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.