From aea7fe656632dc07f422bec9e89e92cf05a26a3b Mon Sep 17 00:00:00 2001 From: eugenesvk Date: Tue, 28 May 2024 02:57:48 +0700 Subject: [PATCH] add dummy WinMsg types outside of Windows --- parser/src/cfg/linux.rs | 2 ++ parser/src/cfg/macos.rs | 2 ++ parser/src/cfg/mod.rs | 8 ++++++++ parser/src/custom_action.rs | 3 --- 4 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 parser/src/cfg/linux.rs create mode 100644 parser/src/cfg/macos.rs diff --git a/parser/src/cfg/linux.rs b/parser/src/cfg/linux.rs new file mode 100644 index 000000000..5e0740386 --- /dev/null +++ b/parser/src/cfg/linux.rs @@ -0,0 +1,2 @@ +#[derive(Default, Debug, Clone, PartialEq, Eq, Hash)] +pub struct WinMsg {} diff --git a/parser/src/cfg/macos.rs b/parser/src/cfg/macos.rs new file mode 100644 index 000000000..5e0740386 --- /dev/null +++ b/parser/src/cfg/macos.rs @@ -0,0 +1,2 @@ +#[derive(Default, Debug, Clone, PartialEq, Eq, Hash)] +pub struct WinMsg {} diff --git a/parser/src/cfg/mod.rs b/parser/src/cfg/mod.rs index c2cc89100..e25c2013a 100755 --- a/parser/src/cfg/mod.rs +++ b/parser/src/cfg/mod.rs @@ -2263,6 +2263,14 @@ fn parse_push_message(ac_params: &[SExpr], s: &ParserState) -> Result<&'static K pub mod windows; #[cfg(any(target_os = "windows", target_os = "unknown"))] pub use windows::*; +#[cfg(any(target_os = "linux"))] +pub mod linux; +#[cfg(any(target_os = "linux"))] +pub use linux::*; +#[cfg(any(target_os = "macos"))] +pub mod macos; +#[cfg(any(target_os = "macos"))] +pub use macos::*; fn to_simple_expr(params: &[SExpr], s: &ParserState) -> Vec { let mut result: Vec = Vec::new(); diff --git a/parser/src/custom_action.rs b/parser/src/custom_action.rs index 358371d81..c8eb2be57 100644 --- a/parser/src/custom_action.rs +++ b/parser/src/custom_action.rs @@ -3,7 +3,6 @@ //! When adding a new custom action, the macro section of the config.adoc documentation may need to //! be updated, to include the new action to the documented list of supported actions in macro. -#[cfg(any(target_os = "windows", target_os = "unknown"))] use crate::cfg::WinMsg; use anyhow::{anyhow, Result}; use core::fmt; @@ -16,9 +15,7 @@ pub enum CustomAction { Cmd(Vec), CmdOutputKeys(Vec), PushMessage(Vec), - #[cfg(any(target_os = "windows", target_os = "unknown"))] WinSendMessage(WinMsg), - #[cfg(any(target_os = "windows", target_os = "unknown"))] WinPostMessage(WinMsg), Unicode(char), Mouse(Btn),