From 1a9ff2f55c36ed6eb324bc248ceff60db537ce2a Mon Sep 17 00:00:00 2001
From: =?utf8?q?Enar=20V=C3=A4ikene?= <enar.vaikene@mt.com>
Date: Sun, 24 Apr 2011 09:32:40 +0300
Subject: [PATCH] Windows build fixes.

---
 src/libs/Common/logger.cpp  |  6 ++++--
 src/libs/Common/version.rc  |  4 ++--
 src/main/GUI/version.rc     |  4 ++--
 src/main/GUI/winconsole.cpp | 12 +++---------
 src/main/GUI/winconsole.h   |  4 ----
 5 files changed, 11 insertions(+), 19 deletions(-)

diff --git a/src/libs/Common/logger.cpp b/src/libs/Common/logger.cpp
index 98d3770..8ccb013 100644
--- a/src/libs/Common/logger.cpp
+++ b/src/libs/Common/logger.cpp
@@ -382,13 +382,15 @@ QString Logger::printf(char const * const fmt, ...) const
 #endif
 
     va_list ap;
-    ::va_start(ap, fmt);
 #ifdef Q_OS_WIN32
+    va_start(ap, fmt);
     _vsnprintf_s(str, sizeof(str), _TRUNCATE, fmt, ap);
+    va_end(ap);
 #else
+    ::va_start(ap, fmt);
     if (::vasprintf(&str, fmt, ap)); // IF is needed to avoid the compiler warning
-#endif
     ::va_end(ap);
+#endif
 
     QString rval(str);
 
diff --git a/src/libs/Common/version.rc b/src/libs/Common/version.rc
index 4ada862..04ed2f8 100644
--- a/src/libs/Common/version.rc
+++ b/src/libs/Common/version.rc
@@ -43,8 +43,8 @@ VS_VERSION_INFO VERSIONINFO
                                 VALUE "FileDescription", VER_FILE_DESCRIPTION_STR
                                 VALUE "FileVersion", VER_FILE_VERSION_STR
                                 VALUE "LegalCopyright", VER_LEGAL_COPYRIGHT_STR
-                                VALUE "OriginalFilename", VER_ORIGINAL_FILENAME_STR
-                                VALUE "ProductName", VER_PRODUC_TNAME_STR
+                                VALUE "OriginalFilename", VER_ORIGINAL_FILE_NAME_STR
+                                VALUE "ProductName", VER_PRODUCT_NAME_STR
                                 VALUE "ProductVersion", VER_PRODUCT_VERSION_STR
                                 VALUE "Build Date", VER_PRODUCT_DATE_STR
                                 VALUE "Module Name", VER_MODULE_NAME_STR
diff --git a/src/main/GUI/version.rc b/src/main/GUI/version.rc
index bf94cb0..695d42b 100644
--- a/src/main/GUI/version.rc
+++ b/src/main/GUI/version.rc
@@ -43,8 +43,8 @@ VS_VERSION_INFO VERSIONINFO
                                 VALUE "FileDescription", VER_FILE_DESCRIPTION_STR
                                 VALUE "FileVersion", VER_FILE_VERSION_STR
                                 VALUE "LegalCopyright", VER_LEGAL_COPYRIGHT_STR
-                                VALUE "OriginalFilename", VER_ORIGINAL_FILENAME_STR
-                                VALUE "ProductName", VER_PRODUC_TNAME_STR
+                                VALUE "OriginalFilename", VER_ORIGINAL_FILE_NAME_STR
+                                VALUE "ProductName", VER_PRODUCT_NAME_STR
                                 VALUE "ProductVersion", VER_PRODUCT_VERSION_STR
                                 VALUE "Build Date", VER_PRODUCT_DATE_STR
                                 VALUE "Module Name", VER_MODULE_NAME_STR
diff --git a/src/main/GUI/winconsole.cpp b/src/main/GUI/winconsole.cpp
index 6a59c69..cd35c33 100644
--- a/src/main/GUI/winconsole.cpp
+++ b/src/main/GUI/winconsole.cpp
@@ -17,18 +17,14 @@
  * Agreement provided with the Software.
  */
 
-#ifdef Q_OS_WIN32
-
 #include "winconsole.h"
 
-#define _CRT_SECURE_NO_WARNINGS
+#define _CRT_SECURE_NO_DEPRECATE
 
 #include <windows.h>
 #include <stdio.h>
 
-using namespace eVaf::GUI::Internal;
-
-void enableWinConsole()
+void eVaf::GUI::Internal::enableWinConsole()
 {
     AllocConsole();
     freopen("conin$", "r", stdin);
@@ -36,6 +32,4 @@ void enableWinConsole()
     freopen("conout$", "w", stderr);
 }
 
-#undef _CRT_SECURE_NO_WARNINGS
-
-#endif
+#undef _CRT_SECURE_NO_DEPRECATE
diff --git a/src/main/GUI/winconsole.h b/src/main/GUI/winconsole.h
index dc075b1..128b5ea 100644
--- a/src/main/GUI/winconsole.h
+++ b/src/main/GUI/winconsole.h
@@ -24,15 +24,11 @@ namespace eVaf {
 namespace GUI {
 namespace Internal {
 
-#ifdef Q_OS_WIN32
-
 /**
  * Enables the console window on Windows
  */
 void enableWinConsole();
 
-#endif
-
 } // namespace eVaf::GUI::Internal
 } // namespace eVaf::GUI
 } // namespace eVaf
-- 
2.49.0