mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-23 22:01:31 +11:00
Fix run_return example build error on non-desktop platforms (#1067)
This commit is contained in:
parent
5a206de620
commit
a28b60578d
|
@ -1,11 +1,21 @@
|
||||||
use winit::{
|
// Limit this example to only compatible platforms.
|
||||||
event::{Event, WindowEvent},
|
#[cfg(any(
|
||||||
event_loop::{ControlFlow, EventLoop},
|
target_os = "windows",
|
||||||
platform::desktop::EventLoopExtDesktop,
|
target_os = "macos",
|
||||||
window::WindowBuilder,
|
target_os = "linux",
|
||||||
};
|
target_os = "dragonfly",
|
||||||
|
target_os = "freebsd",
|
||||||
|
target_os = "netbsd",
|
||||||
|
target_os = "openbsd"
|
||||||
|
))]
|
||||||
fn main() {
|
fn main() {
|
||||||
|
use winit::{
|
||||||
|
event::{Event, WindowEvent},
|
||||||
|
event_loop::{ControlFlow, EventLoop},
|
||||||
|
platform::desktop::EventLoopExtDesktop,
|
||||||
|
window::WindowBuilder,
|
||||||
|
};
|
||||||
|
|
||||||
let mut event_loop = EventLoop::new();
|
let mut event_loop = EventLoop::new();
|
||||||
|
|
||||||
let window = WindowBuilder::new()
|
let window = WindowBuilder::new()
|
||||||
|
@ -39,3 +49,8 @@ fn main() {
|
||||||
|
|
||||||
println!("Okay we're done now for real.");
|
println!("Okay we're done now for real.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(any(target_os = "ios", target_os = "android", target_os = "emscripten"))]
|
||||||
|
fn main() {
|
||||||
|
println!("This platform doesn't support run_return.");
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue