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

fix: Show an error at compile-time if no raw-window-handle feature is enabled for the winit adapter #339

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions platforms/winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ compile_error!(
"Both \"async-io\" (default) and \"tokio\" features cannot be enabled at the same time."
);

#[cfg(all(not(feature = "rwh_05"), not(feature = "rwh_06")))]
compile_error!("Either \"rwh_06\" (default) or \"rwh_05\" feature must be enabled.");

#[cfg(all(feature = "rwh_05", feature = "rwh_06"))]
compile_error!(
"Both \"rwh_06\" (default) and \"rwh_05\" features cannot be enabled at the same time."
);

use accesskit::{ActionHandler, ActionRequest, TreeUpdate};
use winit::{
event::WindowEvent,
Expand All @@ -57,9 +65,6 @@ use rwh_06 as raw_window_handle;

mod platform_impl;

#[cfg(all(feature = "rwh_05", feature = "rwh_06"))]
compile_error!("Cannot enable both 'rwh_05' and 'rwh_06' features at the same time");

#[derive(Debug)]
pub struct ActionRequestEvent {
pub window_id: WindowId,
Expand Down