Use cfg aliases throught the code base

Co-authored-by: Mads Marquart <mads@marquart.dk>
This commit is contained in:
Amr Bashir 2022-12-25 09:57:27 +02:00 committed by GitHub
parent 58ec458877
commit 5e77d70245
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 185 additions and 227 deletions

View file

@ -1,28 +1,22 @@
use crate::monitor::{MonitorHandle as RootMonitorHandle, VideoMode as RootVideoMode};
use crate::window::Fullscreen as RootFullscreen;
#[cfg(target_os = "windows")]
#[cfg(windows_platform)]
#[path = "windows/mod.rs"]
mod platform;
#[cfg(any(
target_os = "linux",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd"
))]
#[cfg(any(x11_platform, wayland_platform))]
#[path = "linux/mod.rs"]
mod platform;
#[cfg(target_os = "macos")]
#[cfg(macos_platform)]
#[path = "macos/mod.rs"]
mod platform;
#[cfg(target_os = "android")]
#[cfg(android_platform)]
#[path = "android/mod.rs"]
mod platform;
#[cfg(target_os = "ios")]
#[cfg(ios_platform)]
#[path = "ios/mod.rs"]
mod platform;
#[cfg(target_arch = "wasm32")]
#[cfg(wasm_platform)]
#[path = "web/mod.rs"]
mod platform;
@ -58,15 +52,12 @@ impl From<Fullscreen> for RootFullscreen {
}
#[cfg(all(
not(target_os = "ios"),
not(target_os = "windows"),
not(target_os = "linux"),
not(target_os = "macos"),
not(target_os = "android"),
not(target_os = "dragonfly"),
not(target_os = "freebsd"),
not(target_os = "netbsd"),
not(target_os = "openbsd"),
not(target_arch = "wasm32"),
not(ios_platform),
not(windows_platform),
not(macos_platform),
not(android_platform),
not(x11_platform),
not(wayland_platform),
not(wasm_platform),
))]
compile_error!("The platform you're compiling for is not supported by winit");