From d4687baa63a8a814fa794c6c095d6bb0a6f60425 Mon Sep 17 00:00:00 2001 From: Jeffrey Morlan Date: Mon, 30 Jun 2008 16:18:46 +0000 Subject: [PATCH] Get explorer working again, by making wmain explicitly call the C++ initialization function __main. gcc only adds the call automatically in a function called main. svn path=/trunk/; revision=34222 --- reactos/lib/3rdparty/mingw/wmain.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reactos/lib/3rdparty/mingw/wmain.c b/reactos/lib/3rdparty/mingw/wmain.c index 6ae8f54a897..ef363db8e79 100644 --- a/reactos/lib/3rdparty/mingw/wmain.c +++ b/reactos/lib/3rdparty/mingw/wmain.c @@ -16,6 +16,7 @@ #define ISSPACE(a) (a == ' ' || a == '\t') +extern void __main(); extern int PASCAL wWinMain (HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR szCmdLine, int nShow); @@ -26,6 +27,12 @@ wmain (int argc, const wchar_t *argv[], const wchar_t *environ[]) STARTUPINFOW startinfo; int nRet; +#ifdef __GNUC__ + /* C++ initialization. (gcc inserts this call automatically for + * a function called "main", but not for "wmain") */ + __main(); +#endif + /* Get the command line passed to the process. */ szCmd = GetCommandLineW (); GetStartupInfoW (&startinfo);