lib-misc-utils · crate
cfg-if
Kinogaki's own cfg-if, published under the crates.io name so the frozen naga, wgpu, wgpu-hal, blake3 and libloading resolve to it through [patch.crates-io].
- Repository
- lib-misc-utils (kinogaki/lib-misc-utils)
- Folder
libs/lib-misc-utils/crates/cfg-if- Source
- 1 file, 37 lines
- Tests
- 1 file, 57 lines
What it is
Kinogaki's own cfg-if, published under the crates.io name so the frozen naga, wgpu, wgpu-hal, blake3 and libloading resolve to it through [patch.crates-io]. It is not upstream cfg-if.
cfg_if! takes an if #[cfg(a)] { .. } else if #[cfg(b)] { .. } else { .. } chain and keeps the tokens of the first branch whose predicate holds: each branch is emitted as a nested macro call under its own predicate and the negation of every earlier one, so the branches may hold items, statements or a block's tail expression.
Depends on
None.
Third-party
None.
Used by
None.
Third-party crates using it
blake3, libloading, naga, wgpu, wgpu-hal
Modules
One file: the crate root.
Public types and traits
At the crate root
Macros cfg_if
