Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OS-specific Flags #36

Open
VincentRPS opened this issue Oct 30, 2024 · 1 comment
Open

OS-specific Flags #36

VincentRPS opened this issue Oct 30, 2024 · 1 comment
Labels
a: usability Area: Usability comp: medium Complexity: Medium issue: feature A feature request p: low Priority: Low
Milestone

Comments

@VincentRPS
Copy link
Contributor

VincentRPS commented Oct 30, 2024

Add a way to flag the compiler not to compile a specific piece of code on some systems.
This could either be implemented in the stdlib as a macro, or some other way in the compiler itself.

@cfg(system = "windows")
const Window = Window::from_windows(winapi::Something());

@cfg(system = "linux")
const Window = Window::from_linux(syslinux::Something());

@cfg(system = "macos")
const Window = Window::from_macos(sysmacos::Something());
@VincentRPS VincentRPS added issue: feature A feature request comp: medium Complexity: Medium p: low Priority: Low a: usability Area: Usability labels Oct 30, 2024
@elenakrittik
Copy link
Contributor

elenakrittik commented Oct 30, 2024

maybe @cfg instead? that'd be more versatile and convey the meaning better

@VincentRPS VincentRPS added this to the 0.1 milestone Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: usability Area: Usability comp: medium Complexity: Medium issue: feature A feature request p: low Priority: Low
Projects
None yet
Development

No branches or pull requests

2 participants