msvcrt: Rename _environ to avoid a conflict on Solaris.

This commit is contained in:
Dmitry Timoshkov 2008-01-08 12:20:30 +08:00 committed by Alexandre Julliard
parent fb5d0bfee1
commit a88f03e22f
4 changed files with 11 additions and 11 deletions

View File

@ -50,7 +50,7 @@ char **MSVCRT___argv;
MSVCRT_wchar_t **MSVCRT___wargv;
char *MSVCRT__acmdln;
MSVCRT_wchar_t *MSVCRT__wcmdln;
char **_environ = 0;
char **MSVCRT__environ = 0;
MSVCRT_wchar_t **_wenviron = 0;
char **MSVCRT___initenv = 0;
MSVCRT_wchar_t **MSVCRT___winitenv = 0;
@ -203,9 +203,9 @@ MSVCRT_wchar_t*** CDECL __p___wargv(void) { return &MSVCRT___wargv; }
*/
char*** CDECL __p__environ(void)
{
if (!_environ)
_environ = msvcrt_SnapshotOfEnvironmentA(NULL);
return &_environ;
if (!MSVCRT__environ)
MSVCRT__environ = msvcrt_SnapshotOfEnvironmentA(NULL);
return &MSVCRT__environ;
}
/*********************************************************************
@ -302,7 +302,7 @@ void msvcrt_free_args(void)
/* FIXME: more things to free */
HeapFree(GetProcessHeap(), 0, MSVCRT___initenv);
HeapFree(GetProcessHeap(), 0, MSVCRT___winitenv);
HeapFree(GetProcessHeap(), 0, _environ);
HeapFree(GetProcessHeap(), 0, MSVCRT__environ);
HeapFree(GetProcessHeap(), 0, _wenviron);
HeapFree(GetProcessHeap(), 0, MSVCRT__pgmptr);
HeapFree(GetProcessHeap(), 0, MSVCRT__wpgmptr);

View File

@ -105,8 +105,8 @@ int CDECL _putenv(const char *str)
if ((ret == -1) && (GetLastError() == ERROR_ENVVAR_NOT_FOUND)) ret = 0;
/* Update the __p__environ array only when already initialized */
if (_environ)
_environ = msvcrt_SnapshotOfEnvironmentA(_environ);
if (MSVCRT__environ)
MSVCRT__environ = msvcrt_SnapshotOfEnvironmentA(MSVCRT__environ);
if (_wenviron)
_wenviron = msvcrt_SnapshotOfEnvironmentW(_wenviron);
@ -151,8 +151,8 @@ int CDECL _wputenv(const MSVCRT_wchar_t *str)
if ((ret == -1) && (GetLastError() == ERROR_ENVVAR_NOT_FOUND)) ret = 0;
/* Update the __p__environ array only when already initialized */
if (_environ)
_environ = msvcrt_SnapshotOfEnvironmentA(_environ);
if (MSVCRT__environ)
MSVCRT__environ = msvcrt_SnapshotOfEnvironmentA(MSVCRT__environ);
if (_wenviron)
_wenviron = msvcrt_SnapshotOfEnvironmentW(_wenviron);

View File

@ -119,7 +119,7 @@ void msvcrt_set_errno(int);
void _purecall(void);
void _amsg_exit(int errnum);
extern char **_environ;
extern char **MSVCRT__environ;
extern MSVCRT_wchar_t **_wenviron;
extern char ** msvcrt_SnapshotOfEnvironmentA(char **);

View File

@ -208,7 +208,7 @@
@ cdecl _ecvt(double long ptr ptr)
@ cdecl _endthread ()
@ cdecl _endthreadex(long)
@ extern _environ
@ extern _environ MSVCRT__environ
@ cdecl _eof(long)
@ cdecl _errno() MSVCRT__errno
@ cdecl _except_handler2(ptr ptr ptr ptr)