Name |
Date |
Size |
#Lines |
LOC |
||
---|---|---|---|---|---|---|
.. | - | - | ||||
.github/workflows/ | 03-May-2024 | - | 57 | 53 | ||
patches/ | 03-May-2024 | - | 15 | 13 | ||
src/ | 03-May-2024 | - | 181 | 120 | ||
tests/ | 03-May-2024 | - | 15 | 13 | ||
.cargo_vcs_info.json | D | 03-May-2024 | 74 | 6 | 5 | |
.gitignore | D | 03-May-2024 | 18 | 3 | 2 | |
Android.bp | D | 03-May-2024 | 2.5 KiB | 89 | 83 | |
Cargo.toml | D | 03-May-2024 | 1.3 KiB | 37 | 33 | |
Cargo.toml.orig | D | 03-May-2024 | 792 | 26 | 22 | |
LICENSE | D | 03-May-2024 | 10.6 KiB | 202 | 169 | |
LICENSE-APACHE | D | 03-May-2024 | 10.6 KiB | 202 | 169 | |
LICENSE-MIT | D | 03-May-2024 | 1 KiB | 26 | 22 | |
METADATA | D | 03-May-2024 | 513 | 20 | 19 | |
MODULE_LICENSE_APACHE2 | D | 03-May-2024 | 0 | |||
OWNERS | D | 03-May-2024 | 40 | 2 | 1 | |
README.md | D | 03-May-2024 | 1.1 KiB | 48 | 35 | |
TEST_MAPPING | D | 03-May-2024 | 4 KiB | 202 | 201 | |
cargo2android.json | D | 03-May-2024 | 223 | 13 | 12 |
README.md
1# cfg-if 2 3[Documentation](https://docs.rs/cfg-if) 4 5A macro to ergonomically define an item depending on a large number of #[cfg] 6parameters. Structured like an if-else chain, the first matching branch is the 7item that gets emitted. 8 9```toml 10[dependencies] 11cfg-if = "0.1" 12``` 13 14## Example 15 16```rust 17cfg_if::cfg_if! { 18 if #[cfg(unix)] { 19 fn foo() { /* unix specific functionality */ } 20 } else if #[cfg(target_pointer_width = "32")] { 21 fn foo() { /* non-unix, 32-bit functionality */ } 22 } else { 23 fn foo() { /* fallback implementation */ } 24 } 25} 26 27fn main() { 28 foo(); 29} 30``` 31 32# License 33 34This project is licensed under either of 35 36 * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or 37 http://www.apache.org/licenses/LICENSE-2.0) 38 * MIT license ([LICENSE-MIT](LICENSE-MIT) or 39 http://opensource.org/licenses/MIT) 40 41at your option. 42 43### Contribution 44 45Unless you explicitly state otherwise, any contribution intentionally submitted 46for inclusion in `cfg-if` by you, as defined in the Apache-2.0 license, shall be 47dual licensed as above, without any additional terms or conditions. 48