metallang / metal

Metal compiler and toolchain.
MIT License
3 stars 0 forks source link

OS-specific Flags #36

Open VincentRPS opened 1 month ago

VincentRPS commented 1 month ago

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());
elenakrittik commented 1 month ago

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