summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwithmorten <morten.with@gmail.com>2020-11-28 17:57:10 +0100
committerSergeanur <s.anureev@yandex.ua>2020-12-01 03:41:09 +0200
commitb8d3d8f5e460db06d9475a39c0bfb8fc733be872 (patch)
tree93d6d6d9f0f35515b52a97c780b939936c7def77
parent8cb3c071510e7675e35d59c73fc0c86ca30d51a9 (diff)
add -console cmdline arg instead of #if 0/1
# Conflicts: # src/skel/glfw/glfw.cpp # src/skel/win/win.cpp
-rw-r--r--src/skel/glfw/glfw.cpp14
-rw-r--r--src/skel/win/win.cpp14
2 files changed, 17 insertions, 11 deletions
diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp
index cac487b1..bc213c78 100644
--- a/src/skel/glfw/glfw.cpp
+++ b/src/skel/glfw/glfw.cpp
@@ -1479,12 +1479,14 @@ WinMain(HINSTANCE instance,
RwChar** argv;
SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, nil, SPIF_SENDCHANGE);
-#if 1
- // TODO: make this an option somewhere
- AllocConsole();
- freopen("CONIN$", "r", stdin);
- freopen("CONOUT$", "w", stdout);
- freopen("CONOUT$", "w", stderr);
+#ifndef MASTER
+ if (strstr(cmdLine, "-console"))
+ {
+ AllocConsole();
+ freopen("CONIN$", "r", stdin);
+ freopen("CONOUT$", "w", stdout);
+ freopen("CONOUT$", "w", stderr);
+ }
#endif
#else
diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp
index a10a1a92..b2d5a64f 100644
--- a/src/skel/win/win.cpp
+++ b/src/skel/win/win.cpp
@@ -2005,11 +2005,15 @@ WinMain(HINSTANCE instance,
RwChar **argv;
SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, nil, SPIF_SENDCHANGE);
- // TODO: make this an option somewhere
- AllocConsole();
- freopen("CONIN$", "r", stdin);
- freopen("CONOUT$", "w", stdout);
- freopen("CONOUT$", "w", stderr);
+#ifndef MASTER
+ if (strstr(cmdLine, "-console"))
+ {
+ AllocConsole();
+ freopen("CONIN$", "r", stdin);
+ freopen("CONOUT$", "w", stdout);
+ freopen("CONOUT$", "w", stderr);
+ }
+#endif
/*
* Initialize the platform independent data.