Skip to content

Commit

Permalink
fix: Show an error at compile-time if no raw-window-handle feature is…
Browse files Browse the repository at this point in the history
… enabled for the winit adapter (#339)
  • Loading branch information
DataTriny authored Jan 11, 2024
1 parent 8f937ba commit a24f5fd
Showing 1 changed file with 8 additions and 3 deletions.
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

0 comments on commit a24f5fd

Please sign in to comment.