From f9453ee18c7468dc27b8a06ff49d6c159ed86e15 Mon Sep 17 00:00:00 2001 From: Ralf Zerres Date: Wed, 8 Jul 2020 10:52:31 +0200 Subject: [PATCH] main: suppress creation of consol window on MS Windows * Rust applications on Windows always open a new console window if started by double-clicking on the executable. * since rust 1.18 the the macro suppresses this behaviour Signed-off-by: Ralf Zerres --- advotracker/src/main.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/advotracker/src/main.rs b/advotracker/src/main.rs index 3a037f7..4d0e170 100644 --- a/advotracker/src/main.rs +++ b/advotracker/src/main.rs @@ -7,6 +7,8 @@ //#[macro_use] //extern crate lazy_static; +// suppress creation of a new console window on window +#![windows_subsystem = "windows"] //use chrono::{Local, DateTime}; use locales::t; @@ -54,6 +56,14 @@ fn main() -> Result<(), Box> { use tracing_subscriber::fmt; use viperus::Viperus; + let machine_kind = if cfg!(unix) { + "unix" + } else if cfg!(windows) { + "windows" + } else { + "unknown/unsupported" + }; + //use advotracker::callbacks::policy_check::is_valid; //use advotracker::data::structures::{PolicyCode, PolicyDataList, PolicyList}; // WIP: can't push pointer by value to widget, call import in widget callback for now