#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);
 
 
                                 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
 
                                 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
 
  * 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);
     freopen("conout$", "w", stderr);
 }
 
-#undef _CRT_SECURE_NO_WARNINGS
-
-#endif
+#undef _CRT_SECURE_NO_DEPRECATE
 
 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