{"id":13503114,"url":"https://github.com/rust-lang/cfg-if","last_synced_at":"2025-04-14T18:15:18.981Z","repository":{"id":34743906,"uuid":"38723660","full_name":"rust-lang/cfg-if","owner":"rust-lang","description":"A if/elif-like macro for Rust #[cfg] statements","archived":false,"fork":false,"pushed_at":"2024-10-28T21:07:47.000Z","size":822,"stargazers_count":582,"open_issues_count":6,"forks_count":42,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-04-14T18:15:13.014Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rust-lang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-07-08T01:07:40.000Z","updated_at":"2025-04-14T06:04:48.000Z","dependencies_parsed_at":"2024-02-17T06:25:47.146Z","dependency_job_id":"219a6e6b-9362-4032-be12-9691a7d6e14f","html_url":"https://github.com/rust-lang/cfg-if","commit_stats":{"total_commits":82,"total_committers":18,"mean_commits":4.555555555555555,"dds":"0.47560975609756095","last_synced_commit":"4edf32745bf5039868f1f258f7fa94603eec5cf5"},"previous_names":["alexcrichton/cfg-if"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-lang%2Fcfg-if","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-lang%2Fcfg-if/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-lang%2Fcfg-if/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-lang%2Fcfg-if/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rust-lang","download_url":"https://codeload.github.com/rust-lang/cfg-if/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248933341,"owners_count":21185460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T22:02:37.674Z","updated_at":"2025-04-14T18:15:18.955Z","avatar_url":"https://github.com/rust-lang.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# cfg-if\n\n[Documentation](https://docs.rs/cfg-if)\n\nA macro to ergonomically define an item depending on a large number of #[cfg]\nparameters. Structured like an if-else chain, the first matching branch is the\nitem that gets emitted.\n\n```toml\n[dependencies]\ncfg-if = \"1.0\"\n```\n\n## Example\n\n```rust\ncfg_if::cfg_if! {\n    if #[cfg(unix)] {\n        fn foo() { /* unix specific functionality */ }\n    } else if #[cfg(target_pointer_width = \"32\")] {\n        fn foo() { /* non-unix, 32-bit functionality */ }\n    } else {\n        fn foo() { /* fallback implementation */ }\n    }\n}\n\nfn main() {\n    foo();\n}\n```\nThe `cfg_if!` block above is expanded to:\n```rust\n#[cfg(unix)]\nfn foo() { /* unix specific functionality */ }\n#[cfg(all(target_pointer_width = \"32\", not(unix)))]\nfn foo() { /* non-unix, 32-bit functionality */ }\n#[cfg(not(any(unix, target_pointer_width = \"32\")))]\nfn foo() { /* fallback implementation */ }        \n```\n\n# License\n\nThis project is licensed under either of\n\n * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or\n   https://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or\n   https://opensource.org/licenses/MIT)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in `cfg-if` by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-lang%2Fcfg-if","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frust-lang%2Fcfg-if","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-lang%2Fcfg-if/lists"}