Added environ support for Darwin.

This commit is contained in:
Emmanuel Maillard 2004-05-25 04:50:08 +00:00 committed by Alexandre Julliard
parent 616cffb8b7
commit 7ee8adfd39
2 changed files with 8 additions and 3 deletions

View File

@ -276,9 +276,8 @@ const char *wine_get_user_name(void)
void wine_exec_wine_binary( const char *name, char **argv, char **envp ) void wine_exec_wine_binary( const char *name, char **argv, char **envp )
{ {
const char *path, *pos, *ptr; const char *path, *pos, *ptr;
extern char **environ;
if (!envp) envp = environ; if (!envp) envp = __wine_main_environ;
if (!name) name = argv0_name; if (!name) name = argv0_name;
/* first, try bin directory */ /* first, try bin directory */

View File

@ -71,6 +71,13 @@ static const char **dll_paths;
static int nb_dll_paths; static int nb_dll_paths;
static int dll_path_maxlen; static int dll_path_maxlen;
#ifdef __APPLE__
#include <crt_externs.h>
#define environ (*_NSGetEnviron())
#else
extern char **environ;
#endif
extern void mmap_init(void); extern void mmap_init(void);
/* build the dll load path from the WINEDLLPATH variable */ /* 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 ) void wine_init( int argc, char *argv[], char *error, int error_size )
{ {
extern char **environ;
char *wine_debug; char *wine_debug;
int file_exists; int file_exists;
void *ntdll; void *ntdll;