From 3bb0ccdfbed27c68aea39268ef18edb62863fdfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Boh=C3=A1=C4=8Dek?= Date: Sat, 4 Feb 2023 19:54:57 +0100 Subject: [PATCH] fix: do not use windows ifs --- src/Local/NosSmooth.Comms.Inject/WinConsole.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Local/NosSmooth.Comms.Inject/WinConsole.cs b/src/Local/NosSmooth.Comms.Inject/WinConsole.cs index 1287d59..5a9bf32 100644 --- a/src/Local/NosSmooth.Comms.Inject/WinConsole.cs +++ b/src/Local/NosSmooth.Comms.Inject/WinConsole.cs @@ -20,7 +20,6 @@ internal static class WinConsole /// Whether to create (true) or attach (false) to a console. public static void Initialize(bool alwaysCreateNewConsole = true) { -#if WINDOWS bool consoleAttached = true; if (alwaysCreateNewConsole || (AttachConsole(ATTACH_PARRENT) == 0 @@ -34,7 +33,6 @@ internal static class WinConsole InitializeOutStream(); InitializeInStream(); } -#endif } /// @@ -42,11 +40,9 @@ internal static class WinConsole /// public static void Close() { -#if WINDOWS FreeConsole(); -#endif } -#if WINDOWS + private static void InitializeOutStream() { var fs = CreateFileStream("CONOUT$", GENERIC_WRITE, FILE_SHARE_WRITE, FileAccess.Write); @@ -138,7 +134,6 @@ internal static class WinConsole [DllImport("kernel32")] private static extern bool FreeConsole(); -#endif private const uint GENERIC_WRITE = 0x40000000; private const uint GENERIC_READ = 0x80000000; -- 2.48.1