Yet another fix for the MacOS X environ brain damage.
This commit is contained in:
parent
62a860988c
commit
9af2bd4803
|
@ -53,7 +53,7 @@ extern int __wine_main_argc;
|
|||
extern char **__wine_main_argv;
|
||||
extern WCHAR **__wine_main_wargv;
|
||||
extern char **__wine_main_environ;
|
||||
extern void wine_init( int argc, char *argv[], char *envp[], char *error, int error_size );
|
||||
extern void wine_init( int argc, char *argv[], char *error, int error_size );
|
||||
|
||||
/* debugging */
|
||||
|
||||
|
|
|
@ -41,6 +41,13 @@
|
|||
#include "winbase.h"
|
||||
#include "wine/library.h"
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <crt_externs.h>
|
||||
#define environ (*_NSGetEnviron())
|
||||
#else
|
||||
extern char **environ;
|
||||
#endif
|
||||
|
||||
/* argc/argv for the Windows application */
|
||||
int __wine_main_argc = 0;
|
||||
char **__wine_main_argv = NULL;
|
||||
|
@ -504,7 +511,7 @@ static void debug_usage(void)
|
|||
*
|
||||
* Main Wine initialisation.
|
||||
*/
|
||||
void wine_init( int argc, char *argv[], char *envp[], char *error, int error_size )
|
||||
void wine_init( int argc, char *argv[], char *error, int error_size )
|
||||
{
|
||||
char *wine_debug;
|
||||
int file_exists;
|
||||
|
@ -515,7 +522,7 @@ void wine_init( int argc, char *argv[], char *envp[], char *error, int error_siz
|
|||
wine_init_argv0_path( argv[0] );
|
||||
__wine_main_argc = argc;
|
||||
__wine_main_argv = argv;
|
||||
__wine_main_environ = envp;
|
||||
__wine_main_environ = environ;
|
||||
mmap_init();
|
||||
|
||||
if ((wine_debug = getenv("WINEDEBUG")))
|
||||
|
|
|
@ -33,7 +33,6 @@ int main( int argc, char *argv[] )
|
|||
{
|
||||
char error[1024];
|
||||
int i;
|
||||
extern char **environ;
|
||||
|
||||
if (wine_main_preload_info)
|
||||
{
|
||||
|
@ -42,7 +41,7 @@ int main( int argc, char *argv[] )
|
|||
wine_main_preload_info[i].size );
|
||||
}
|
||||
|
||||
wine_init( argc, argv, environ, error, sizeof(error) );
|
||||
wine_init( argc, argv, error, sizeof(error) );
|
||||
fprintf( stderr, "wine: failed to initialize: %s\n", error );
|
||||
exit(1);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue