]> danny-edel.de - dspdfviewer.git/commitdiff
win32: replace manual WinMain with mainCRTStartup
authorDanny Edel <mail@danny-edel.de>
Mon, 4 Apr 2016 13:58:53 +0000 (15:58 +0200)
committerDanny Edel <mail@danny-edel.de>
Mon, 4 Apr 2016 13:58:53 +0000 (15:58 +0200)
the mainCRTStartup essentially does the same thing and gets
auto-generated from the compiler.

main.cpp

index 01bc9f71390ec2e735261fa91aa0bcdef03eac32..fa86f98b286d2651066155897c90248130b8206e 100644 (file)
--- a/main.cpp
+++ b/main.cpp
 #include <QTranslator>
 #include <QLibraryInfo>
 
-#if defined ( _WIN32 ) && defined ( NDEBUG )
-#pragma comment(linker, "/SUBSYSTEM:windows")
-#include <Windows.h>
+#if defined ( _WIN32 )
+       #pragma comment(linker, "/ENTRY:mainCRTStartup")
 
-int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
-{
-       int argc = __argc;
-       #define argv __argv
+       #if defined( NDEBUG )
+               #pragma comment(linker, "/SUBSYSTEM:windows")
+       #endif
 
-#else
+#endif
 
 int main(int argc, char** argv)
 {
-
-#endif
        QApplication app(argc, argv);
 
        app.setApplicationName( QString::fromUtf8("dspdfviewer") );