diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-08-25 20:28:42 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-08-25 20:28:42 +1000 |
commit | f0a08aea2213197a2b7e6b6784ec34320aa85abb (patch) | |
tree | b7fc45db9f466034c8bab4fe498bd0ea8e38d5d6 /source/application | |
parent | 8332536399dda90f89b7f96df29f6846272aea0c (diff) |
win: console if launching with debugger
Diffstat (limited to 'source/application')
-rw-r--r-- | source/application/StarMainApplication.hpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/application/StarMainApplication.hpp b/source/application/StarMainApplication.hpp index 18c9fa5..5ba06e7 100644 --- a/source/application/StarMainApplication.hpp +++ b/source/application/StarMainApplication.hpp @@ -18,6 +18,10 @@ namespace Star { LPWSTR* argsList = CommandLineToArgvW(GetCommandLineW(), &nArgs); \ Star::StringList args; \ for (int i = 0; i < nArgs; ++i) args.append(Star::String(argsList[i])); \ + if (IsDebuggerPresent() && AllocConsole()) { \ + freopen("CONOUT$", "w", stdout); \ + freopen("CONOUT$", "w", stderr); \ + } \ return Star::runMainApplication(Star::make_unique<ApplicationClass>(), args); \ } |