From: Gurusamy Sarathy Date: Sun, 6 Apr 1997 04:31:11 +0000 (-0500) Subject: perlwin-97a_4: win32 environ fix X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dcb2879abe1a588042098f71cb130a72def08afb;p=p5sagit%2Fp5-mst-13.2.git perlwin-97a_4: win32 environ fix private-msgid: 199704060431.XAA23400@aatma.engin.umich.edu --- diff --git a/win32/win32.c b/win32/win32.c index 7bb003d..ed24251 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -756,6 +756,12 @@ win32_errno(void) return (pIOSubSystem->pfnerrno()); } +DllExport char *** +win32_environ(void) +{ + return (pIOSubSystem->pfnenviron()); +} + /* the rest are the remapped stdio routines */ DllExport FILE * win32_stderr(void) diff --git a/win32/win32io.c b/win32/win32io.c index b4f5824..c9cc8e2 100644 --- a/win32/win32io.c +++ b/win32/win32io.c @@ -31,6 +31,12 @@ dummy_errno(void) return (&(errno)); } +static char *** +dummy_environ(void) +{ + return (&(_environ)); +} + /* the rest are the remapped stdio routines */ static FILE * dummy_stderr(void) @@ -184,6 +190,7 @@ __declspec(dllexport) WIN32_IOSUBSYSTEM win32stdio = { 12345678L, /* begin of structure; */ dummy_errno, /* (*pfunc_errno)(void); */ + dummy_environ, /* (*pfunc_environ)(void); */ dummy_stdin, /* (*pfunc_stdin)(void); */ dummy_stdout, /* (*pfunc_stdout)(void); */ dummy_stderr, /* (*pfunc_stderr)(void); */ diff --git a/win32/win32io.h b/win32/win32io.h index f73eea1..4955973 100644 --- a/win32/win32io.h +++ b/win32/win32io.h @@ -4,6 +4,7 @@ typedef struct { int signature_begin; int * (*pfnerrno)(void); +char ***(*pfnenviron)(void); FILE* (*pfnstdin)(void); FILE* (*pfnstdout)(void); FILE* (*pfnstderr)(void); diff --git a/win32/win32iop.h b/win32/win32iop.h index d699e03..eadc08f 100644 --- a/win32/win32iop.h +++ b/win32/win32iop.h @@ -10,6 +10,7 @@ * function prototypes for our own win32io layer */ EXT int * win32_errno(); +EXT char *** win32_environ(); EXT FILE* win32_stdin(void); EXT FILE* win32_stdout(void); EXT FILE* win32_stderr(void); @@ -77,6 +78,7 @@ void * SetIOSubSystem(void *piosubsystem); */ #ifndef WIN32IO_IS_STDIO #undef errno +#undef environ #undef stderr #undef stdin #undef stdout @@ -89,6 +91,7 @@ void * SetIOSubSystem(void *piosubsystem); #define feof(f) win32_feof(f) #define ferror(f) win32_ferror(f) #define errno (*win32_errno()) +#define environ (*win32_environ()) #define strerror win32_strerror /*