diff --git a/libs/wine/config.c b/libs/wine/config.c index cb4b00092f2..957dc25e327 100644 --- a/libs/wine/config.c +++ b/libs/wine/config.c @@ -276,9 +276,8 @@ const char *wine_get_user_name(void) void wine_exec_wine_binary( const char *name, char **argv, char **envp ) { const char *path, *pos, *ptr; - extern char **environ; - if (!envp) envp = environ; + if (!envp) envp = __wine_main_environ; if (!name) name = argv0_name; /* first, try bin directory */ diff --git a/libs/wine/loader.c b/libs/wine/loader.c index 9eb7d43bd48..2dcb808a37b 100644 --- a/libs/wine/loader.c +++ b/libs/wine/loader.c @@ -71,6 +71,13 @@ static const char **dll_paths; static int nb_dll_paths; static int dll_path_maxlen; +#ifdef __APPLE__ +#include +#define environ (*_NSGetEnviron()) +#else +extern char **environ; +#endif + extern void mmap_init(void); /* build the dll load path from the WINEDLLPATH variable */ @@ -506,7 +513,6 @@ static void debug_usage(void) */ void wine_init( int argc, char *argv[], char *error, int error_size ) { - extern char **environ; char *wine_debug; int file_exists; void *ntdll;