From b60a0956edb144d448dc087b93a6a4d98ca3e4a3 Mon Sep 17 00:00:00 2001 From: Guenter Bartsch Date: Sat, 16 Oct 2021 23:45:24 +0200 Subject: [PATCH] do not pass on Output() if we have been started from workbench so we avoid a CONSOLE: window being opened --- src/compiler/aqb.c | 2 ++ src/compiler/options.h | 1 + src/compiler/run.c | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/compiler/aqb.c b/src/compiler/aqb.c index 1883150d..3ec43ba9 100644 --- a/src/compiler/aqb.c +++ b/src/compiler/aqb.c @@ -60,6 +60,7 @@ extern struct DOSBase *DOSBase; char aqb_home[PATH_MAX]; char aqb_lib[PATH_MAX]; char aqb_help[PATH_MAX]; +bool aqb_wbstart = FALSE; static void print_usage(char *argv[]) { @@ -329,6 +330,7 @@ int main (int argc, char *argv[]) #ifdef __amigaos__ if (argc == 0) // workbench launch { + aqb_wbstart = TRUE; struct WBStartup *wb_msg = (struct WBStartup *) argv; struct WBArg *wbarg = wb_msg->sm_ArgList; for (uint16_t i=0; i < wb_msg->sm_NumArgs; i++, wbarg++) diff --git a/src/compiler/options.h b/src/compiler/options.h index a0296ec8..483529ab 100644 --- a/src/compiler/options.h +++ b/src/compiler/options.h @@ -11,6 +11,7 @@ extern char aqb_home[PATH_MAX]; extern char aqb_lib[PATH_MAX]; extern char aqb_help[PATH_MAX]; +extern bool aqb_wbstart; /* * compiler options diff --git a/src/compiler/run.c b/src/compiler/run.c index d2d6011e..38a17457 100644 --- a/src/compiler/run.c +++ b/src/compiler/run.c @@ -4,6 +4,7 @@ #include "run.h" #include "logger.h" #include "ui.h" +#include "options.h" static RUN_state g_debugState = RUN_stateStopped; @@ -94,7 +95,7 @@ static void _launch_process (RUN_env env, char *binfn, char *arg1, bool dbg) env->childProc = CreateNewProcTags(NP_Seglist, (ULONG) env->seglist, NP_FreeSeglist, FALSE, NP_Input, 0l, - NP_Output, Output(), + NP_Output, aqb_wbstart ? 0 : Output(), NP_CloseInput, FALSE, NP_CloseOutput, FALSE, NP_StackSize, DEFAULT_STACKSIZE,