From: Bruno Haible Date: Sat, 17 Sep 2011 15:34:03 +0000 (+0200) Subject: putenv: Support for MSVC. X-Git-Tag: v0.1~1887 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=c124cabd6716e4c57fde3b7d0d518fa61e25f12f;p=gnulib.git putenv: Support for MSVC. * modules/putenv (Depends-on): Add environ. * lib/putenv.c (environ): Disable declaration. * lib/unistd.in.h: Update comment. --- diff --git a/ChangeLog b/ChangeLog index 6b18485ce6..ef33264604 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-09-17 Bruno Haible + + putenv: Support for MSVC. + * modules/putenv (Depends-on): Add environ. + * lib/putenv.c (environ): Disable declaration. + * lib/unistd.in.h: Update comment. + 2011-09-17 Bruno Haible math: Avoid macro redefinition warnings on MSVC. diff --git a/lib/putenv.c b/lib/putenv.c index 68e5fec31b..3c332791bb 100644 --- a/lib/putenv.c +++ b/lib/putenv.c @@ -34,10 +34,12 @@ #include #include -#if HAVE_GNU_LD +#if _LIBC +# if HAVE_GNU_LD # define environ __environ -#else +# else extern char **environ; +# endif #endif #if _LIBC diff --git a/lib/unistd.in.h b/lib/unistd.in.h index 90de697e0d..e3fb8c6b96 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -75,7 +75,8 @@ #endif /* mingw fails to declare _exit in . */ -/* mingw, BeOS, Haiku declare environ in , not in . */ +/* mingw, MSVC, BeOS, Haiku declare environ in , not in + . */ /* Solaris declares getcwd not only in but also in . */ /* But avoid namespace pollution on glibc systems. */ #ifndef __GLIBC__ diff --git a/modules/putenv b/modules/putenv index 7476af11ae..3321a5e95f 100644 --- a/modules/putenv +++ b/modules/putenv @@ -7,6 +7,7 @@ m4/putenv.m4 Depends-on: stdlib +environ [test $REPLACE_PUTENV = 1] malloc-posix [test $REPLACE_PUTENV = 1] configure.ac: