commit | 7da52636420b6747f57298341a41ff86813508f3 | [log] [tgz] |
---|---|---|
author | James Farrell <[email protected]> | Wed Aug 14 18:59:47 2024 +0000 |
committer | James Farrell <[email protected]> | Wed Aug 14 19:31:21 2024 +0000 |
tree | 1ee36a19abf2c98eb4597245c6198d7b3ccb919b | |
parent | 82f61a1b798e39f40b7790738453205be5d3c207 [diff] |
Migrate 25 crates to monorepo async-stream async-stream-impl async-task async-trait atomic atty axum bencher bincode bitreader bstr buddy_system_allocator byteorder bytes camino cast cesu8 cexpr cfg-if ciborium ciborium-io ciborium-ll clap_complete clap_derive clap_lex Bug: 339424309 Test: treehugger Change-Id: I24093a9550d2213cfe90a7c8bfcaf0835508d245
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.