From e5056878c6c2da3f3e45cb3c00205eea15b84ea6 Mon Sep 17 00:00:00 2001 From: Samuel Serapion Date: Thu, 24 Jul 2008 20:15:36 +0000 Subject: [PATCH] Fix passing of command line args so it works on win64 too. svn path=/branches/ros-amd64-bringup/; revision=34754 --- reactos/lib/3rdparty/mingw/crt1.c | 6 +++++- reactos/lib/3rdparty/mingw/wcrt1.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/reactos/lib/3rdparty/mingw/crt1.c b/reactos/lib/3rdparty/mingw/crt1.c index dec13337fb6..e5795642a8a 100644 --- a/reactos/lib/3rdparty/mingw/crt1.c +++ b/reactos/lib/3rdparty/mingw/crt1.c @@ -47,6 +47,10 @@ __MINGW_IMPORT void __set_app_type(int); #endif /* __MSVCRT__ */ +#ifndef __initenv +extern char ***_imp____initenv; +#define __initenv (*_imp____initenv) +#endif /* * Setup the default file handles to have the _CRT_fmode mode, as well as @@ -235,7 +239,7 @@ __mingw_CRTStartup (void) * that one calls WinMain. See main.c in the 'lib' dir * for more details. */ - nRet = main (_argc, _argv, _environ); + nRet = main (_argc, _argv, __initenv); /* * Perform exit processing for the C library. This means diff --git a/reactos/lib/3rdparty/mingw/wcrt1.c b/reactos/lib/3rdparty/mingw/wcrt1.c index 28e933ba76b..4edbbdcfe16 100644 --- a/reactos/lib/3rdparty/mingw/wcrt1.c +++ b/reactos/lib/3rdparty/mingw/wcrt1.c @@ -45,6 +45,10 @@ extern int wmain (int, wchar_t **, wchar_t **); __MINGW_IMPORT void __set_app_type(int); #endif /* __MSVCRT__ */ +#ifndef __winitenv +extern wchar_t ***_imp____winitenv; +#define __winitenv (*_imp____winitenv) +#endif /* * Setup the default file handles to have the _CRT_fmode mode, as well as @@ -233,7 +237,7 @@ __mingw_wCRTStartup (void) * that one calls WinMain. See main.c in the 'lib' dir * for more details. */ - nRet = wmain (_argc, _wargv, NULL); + nRet = wmain (_argc, _wargv, __winitenv); /* * Perform exit processing for the C library. This means