https://github.com/murphsicles/cfg-if
Conditional compilation macro for Zeta — cfg_if! { if #[cfg(...)] { ... } }
https://github.com/murphsicles/cfg-if
Last synced: 22 days ago
JSON representation
Conditional compilation macro for Zeta — cfg_if! { if #[cfg(...)] { ... } }
- Host: GitHub
- URL: https://github.com/murphsicles/cfg-if
- Owner: murphsicles
- License: mit
- Created: 2026-05-15T20:55:48.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-05-15T23:28:25.000Z (2 months ago)
- Last Synced: 2026-05-16T01:58:38.953Z (2 months ago)
- Size: 3.91 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @std/cfg-if — Conditional Compilation Macro for Zeta
Auto-converted from [cfg-if](https://crates.io/crates/cfg-if) v1.0.4 via [Dark Factory](https://github.com/murphsicles/dark-factory).
## Features
- **cfg_if!** — ergonomic conditional compilation similar to `if/else if/else` chains
- **Compile-time** — evaluated at compile time, dead branches are eliminated
- **Composable** — supports nested cfg_if! blocks
## Usage
```zeta
use @std/cfg_if::cfg_if;
cfg_if! {
if #[cfg(target_os = "linux")] {
println!("Running on Linux");
} else if #[cfg(target_os = "macos")] {
println!("Running on macOS");
} else {
println!("Running on an unknown OS");
}
}
```
## Stats: 1 file, 41 lines, 0 unsupported items
## License: MIT