From af7b970e76b9886838401933a869423f0a7216a2 Mon Sep 17 00:00:00 2001 From: Guillermo Rodriguez Garcia Date: Fri, 10 Mar 2000 07:29:51 +0000 Subject: [PATCH] Fix from Mumit Khan to allow mingw DLL compilation git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6584 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/app.h | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/include/wx/app.h b/include/wx/app.h index 68749834a0..cb327df858 100644 --- a/include/wx/app.h +++ b/include/wx/app.h @@ -380,15 +380,35 @@ public: #define WXAPIENTRY WXFAR wxSTDCALL #endif - #define IMPLEMENT_WXWIN_MAIN \ - int WXAPIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,\ + // Patch from Mumit Khan to allow DLL compilation under mingw. Note that + // this includes which is a bad thing because it prevents + // wxWindows to work with MFC, so for now I'm making this change for + // mingw/cygwin only (these don't work with MFC yet). GRG Mar/2000 + #ifdef(__GNUWIN32__) + #include + #include "wx/msw/winundef.h" + + #define IMPLEMENT_WXWIN_MAIN \ + extern "C" int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int);\ + int WINAPI WinMain(HINSTANCE hInstance, \ + HINSTANCE hPrevInstance,\ LPSTR m_lpCmdLine, int nCmdShow )\ - {\ - return wxEntry((WXHINSTANCE) hInstance, \ - (WXHINSTANCE) hPrevInstance,\ - m_lpCmdLine, nCmdShow);\ - } - + {\ + return wxEntry((WXHINSTANCE) hInstance, \ + (WXHINSTANCE) hPrevInstance,\ + m_lpCmdLine, nCmdShow);\ + } + #else + #define IMPLEMENT_WXWIN_MAIN \ + int WXAPIENTRY WinMain(HINSTANCE hInstance, \ + HINSTANCE hPrevInstance,\ + LPSTR m_lpCmdLine, int nCmdShow )\ + {\ + return wxEntry((WXHINSTANCE) hInstance, \ + (WXHINSTANCE) hPrevInstance,\ + m_lpCmdLine, nCmdShow);\ + } + #endif #else #define IMPLEMENT_WXWIN_MAIN #endif -- 2.45.2