replacing getenv/setenv on Windows - ticket 2636

Jeffrey Altman jaltman at MIT.EDU
Fri Sep 22 01:12:51 EDT 2006


Sam Hartman wrote:
>>>>>> "Jeffrey" == Jeffrey Altman <jaltman at MIT.EDU> writes:
> 
>     Jeffrey> *** I added the following to ticket 2636 last night. ***
> 
>     Jeffrey>        const char * win32_getenv(const char * var) int
>     Jeffrey> win32_setenv(const char *var, const char *value)
> 
>     Jeffrey> and a macro
> 
>     Jeffrey> 	free_envstr(str)
> 
> This proposal is not complete.  Clearly we're not going to replace
> every call to getenv with a conditional call to win32_getenv.  Clearly
> e are also not going to call a function called win32_getenv on posix
> systems.
> 
> --Sam

Sam:

That is not what my proposal said.  My proposal said that a macro would
be used to replace the existing calls to getenv() with win32_getenv()
on Windows systems.  The same for setenv() and win32_setenv().

The only change for POSIX systems is that there would need to be a macro
that is a no-op added so that it can be used to free the allocation
from win32_getenv() on Windows.

Jeffrey Altman




More information about the krbdev mailing list