From 716a03780bacdfcd44aaafb3ed18a22237da5ec0 Mon Sep 17 00:00:00 2001 From: Mirek Fidler Date: Fri, 19 Aug 2022 13:01:18 +0200 Subject: [PATCH] umk console again --- uppsrc/ide/Android/Android.upp | 3 +-- uppsrc/ide/Core/Core.h | 4 ++-- uppsrc/ide/Core/Ide.cpp | 8 ++++---- uppsrc/ide/clang/todo.txt | 2 ++ uppsrc/ide/ide.h | 4 +++- uppsrc/ide/ide.upp | 3 ++- uppsrc/ide/idewin.cpp | 4 ++-- uppsrc/umk/umake.cpp | 2 +- 8 files changed, 17 insertions(+), 13 deletions(-) diff --git a/uppsrc/ide/Android/Android.upp b/uppsrc/ide/Android/Android.upp index 6e4ac8030..f407d92f9 100644 --- a/uppsrc/ide/Android/Android.upp +++ b/uppsrc/ide/Android/Android.upp @@ -2,8 +2,7 @@ description "TheIDE - Android SDK/NDK spport module\377B"; uses ide/Core, - plugin/pcre, - ide\clang; + plugin/pcre; file Android.h, diff --git a/uppsrc/ide/Core/Core.h b/uppsrc/ide/Core/Core.h index 5bb6685a3..3dcb755ed 100644 --- a/uppsrc/ide/Core/Core.h +++ b/uppsrc/ide/Core/Core.h @@ -219,8 +219,8 @@ public: virtual ~IdeContext() {} }; -Ide *TheIde(); -void TheIde(Ide *context); +IdeContext *TheIdeContext(); +void SetTheIde(IdeContext *context); bool IsVerbose(); void PutConsole(const char *s); diff --git a/uppsrc/ide/Core/Ide.cpp b/uppsrc/ide/Core/Ide.cpp index b5b43a26c..8a5d5e365 100644 --- a/uppsrc/ide/Core/Ide.cpp +++ b/uppsrc/ide/Core/Ide.cpp @@ -1,9 +1,9 @@ -#include +#include "Core.h" -static Ide *the_ide; +static IdeContext *the_ide; -Ide *TheIde() { return the_ide; } -void TheIde(Ide *context) { the_ide = context; } +IdeContext *TheIdeContext() { return the_ide; } +void SetTheIde(IdeContext *context) { the_ide = context; } bool IsVerbose() { return the_ide ? the_ide->IsVerbose() : false; } void PutConsole(const char *s) { if(the_ide) the_ide->PutConsole(s); } diff --git a/uppsrc/ide/clang/todo.txt b/uppsrc/ide/clang/todo.txt index 80930696a..b5a6fb3d3 100644 --- a/uppsrc/ide/clang/todo.txt +++ b/uppsrc/ide/clang/todo.txt @@ -153,6 +153,8 @@ ISUES: - Macros with PPInfo +- Heap leaks in Linux + NONCLANG: - Debugger Threads should show active threads first diff --git a/uppsrc/ide/ide.h b/uppsrc/ide/ide.h index e6ed0d1fc..62a7babbe 100644 --- a/uppsrc/ide/ide.h +++ b/uppsrc/ide/ide.h @@ -1248,7 +1248,9 @@ public: ~Ide(); }; -inline void ShowConsole() { if(TheIde()) ((Ide *)TheIde())->ShowConsole(); } +inline Ide *TheIde() { return (Ide *)TheIdeContext(); } + +inline void ShowConsole() { if(TheIde()) TheIde()->ShowConsole(); } void InstantSetup(); diff --git a/uppsrc/ide/ide.upp b/uppsrc/ide/ide.upp index 277933bdc..5908b3ee0 100644 --- a/uppsrc/ide/ide.upp +++ b/uppsrc/ide/ide.upp @@ -21,7 +21,8 @@ uses ide/MacroManager, Report, Core/SSL, - plugin/md; + plugin/md, + ide/clang; file IDE readonly separator, diff --git a/uppsrc/ide/idewin.cpp b/uppsrc/ide/idewin.cpp index d75772883..c4cddb8d2 100644 --- a/uppsrc/ide/idewin.cpp +++ b/uppsrc/ide/idewin.cpp @@ -587,7 +587,7 @@ Ide::Ide() default_charset = CHARSET_UTF8; - TheIde(this); + SetTheIde(this); targetmode = 0; @@ -648,7 +648,7 @@ Ide::Ide() Ide::~Ide() { - TheIde(NULL); + SetTheIde(NULL); } void Ide::Paint(Draw&) {} diff --git a/uppsrc/umk/umake.cpp b/uppsrc/umk/umake.cpp index 43d839b7d..35bff6a2a 100644 --- a/uppsrc/umk/umake.cpp +++ b/uppsrc/umk/umake.cpp @@ -65,7 +65,7 @@ CONSOLE_APP_MAIN #endif Ide ide; - TheIde(&ide); + SetTheIde(&ide); ide.console.SetSlots(CPU_Cores()); ide.console.console = true;