]> granicus.if.org Git - curl/commitdiff
tool_main: make TerminalSettings static
authorDaniel Stenberg <daniel@haxx.se>
Tue, 23 Oct 2018 11:38:48 +0000 (13:38 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 25 Oct 2018 22:59:50 +0000 (00:59 +0200)
Reported-by: Gisle Vanem
Bug: https://github.com/curl/curl/commit/becfe1233ff2b6b0c3e1b6a10048b55b68c2539f#commitcomment-31008819
Closes #3161

src/tool_main.c

index 3a9f0cdff503481a43f8f236afd5062d55abba67..612bfcb6aabacbe85fbaa2f16b67c3e2030075d2 100644 (file)
@@ -238,16 +238,14 @@ static void main_free(struct GlobalConfig *config)
 
 #ifdef _WIN32
 /* TerminalSettings for Windows */
-struct TerminalSettings {
+static struct TerminalSettings {
   HANDLE hStdOut;
   DWORD dwOutputMode;
   UINT nCodepage;
-}TerminalSettings;
-#endif
+} TerminalSettings;
 
 static void configure_terminal(void)
 {
-#ifdef _WIN32
   /*
    * If we're running Windows, enable VT output & set codepage to UTF-8.
    * Note: VT mode flag can be set on any version of Windows, but VT
@@ -273,8 +271,10 @@ static void configure_terminal(void)
                    TerminalSettings.dwOutputMode
                    | ENABLE_VIRTUAL_TERMINAL_PROCESSING);
   }
-#endif
 }
+#else
+#define configure_terminal()
+#endif
 
 static void restore_terminal(void)
 {