{"id":15762393,"url":"https://github.com/williamvenner/cfg_table","last_synced_at":"2025-03-31T09:41:49.740Z","repository":{"id":57546617,"uuid":"409767997","full_name":"WilliamVenner/cfg_table","owner":"WilliamVenner","description":"✨ A simple macro that expands to different values across compilation targets","archived":false,"fork":false,"pushed_at":"2021-11-26T18:50:47.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-11T11:33:56.484Z","etag":null,"topics":["cfg","conditional-compilation","conditional-compile","macro","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/cfg_table","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WilliamVenner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-23T23:07:53.000Z","updated_at":"2021-11-26T18:50:49.000Z","dependencies_parsed_at":"2022-09-05T12:30:51.171Z","dependency_job_id":null,"html_url":"https://github.com/WilliamVenner/cfg_table","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Fcfg_table","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Fcfg_table/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Fcfg_table/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Fcfg_table/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WilliamVenner","download_url":"https://codeload.github.com/WilliamVenner/cfg_table/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246450425,"owners_count":20779406,"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":["cfg","conditional-compilation","conditional-compile","macro","rust"],"created_at":"2024-10-04T11:09:00.406Z","updated_at":"2025-03-31T09:41:49.719Z","avatar_url":"https://github.com/WilliamVenner.png","language":"Rust","readme":"[![crates.io](https://img.shields.io/crates/v/cfg_table.svg)](https://crates.io/crates/cfg_table)\n\n# ✨ `cfg_table`\n\nA simple macro that expands to different values across compilation targets.\n\n## Panics\n\nThis macro will panic at runtime if no matching value is found.\n\n## Example\n\n```rust\n#[macro_use] extern crate cfg_table;\n\nlet var = cfg_table! {\n    [all(target_os = \"freebsd\", target_pointer_width = \"64\", feature = \"my-feature\")] =\u003e 1337, // custom\n\n    // common platforms\n    win32 =\u003e 32,\n    win64 =\u003e 64,\n    linux32 =\u003e 32,\n    linux64 =\u003e 64,\n    macos32 =\u003e 32,\n    macos64 =\u003e 64,\n\n    // pointer widths\n    32 =\u003e 1985,\n    \"32\" =\u003e 1985,\n    64 =\u003e 2003,\n    \"64\" =\u003e 2003,\n\n    _ =\u003e 123, // default value if nothing matches, this must be at the bottom\n};\n\ncfg_table! {\n    win32 =\u003e {\n        println!(\"You're on Windows 32-bit!\");\n    },\n\n    win64 =\u003e {\n        println!(\"You're on Windows 64-bit!\");\n    },\n\n    _ =\u003e {\n        panic!(\"What the heck is a \\\"Linux\\\"?\");\n    },\n};\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliamvenner%2Fcfg_table","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwilliamvenner%2Fcfg_table","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliamvenner%2Fcfg_table/lists"}