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);