summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2021-03-03 01:52:27 +0000
committerSadie Powell <sadie@witchery.services>2021-03-03 01:52:27 +0000
commitd55581a1107de1e548b67d29a9ca0fcb7f1a0572 (patch)
tree7e84901a544935455efd5ade99222960a3a7c9ea /src
parentdbaa0f6be119a1e74e6139d240d77efcba43b504 (diff)
Fix not being able to colour format output to stderr on Windows.
Diffstat (limited to 'src')
-rw-r--r--src/inspircd.cpp24
1 files changed, 5 insertions, 19 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index c0d7a1614..fca3af6b4 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -41,9 +41,11 @@
#include <pwd.h> // setuid
#include <grp.h> // setgid
#else
- WORD g_wOriginalColors;
- WORD g_wBackgroundColor;
- HANDLE g_hStdout;
+ /** Manages formatting lines written to stderr on Windows. */
+ WindowsStream StandardError(STD_ERROR_HANDLE);
+
+ /** Manages formatting lines written to stdout on Windows. */
+ WindowsStream StandardOutput(STD_OUTPUT_HANDLE);
#endif
#include <fstream>
@@ -492,22 +494,6 @@ InspIRCd::InspIRCd(int argc, char** argv)
this->Config->cmdline.argc = argc;
ParseOptions();
-#ifdef _WIN32
- // Initialize the console values
- g_hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
- CONSOLE_SCREEN_BUFFER_INFO bufinf;
- if(GetConsoleScreenBufferInfo(g_hStdout, &bufinf))
- {
- g_wOriginalColors = bufinf.wAttributes & 0x00FF;
- g_wBackgroundColor = bufinf.wAttributes & 0x00F0;
- }
- else
- {
- g_wOriginalColors = FOREGROUND_RED|FOREGROUND_BLUE|FOREGROUND_GREEN;
- g_wBackgroundColor = 0;
- }
-#endif
-
{
ServiceProvider* provs[] =
{