]> Savannah Git Hosting - gnulib.git/commitdiff
putenv: Support for MSVC.
authorBruno Haible <bruno@clisp.org>
Sat, 17 Sep 2011 15:34:03 +0000 (17:34 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 17 Sep 2011 15:34:03 +0000 (17:34 +0200)
* modules/putenv (Depends-on): Add environ.
* lib/putenv.c (environ): Disable declaration.
* lib/unistd.in.h: Update comment.

ChangeLog
lib/putenv.c
lib/unistd.in.h
modules/putenv

index 6b18485ce6ce8eac771cf344a07c4f3425ac5a0b..ef33264604eee77de42cf87ad60459ee198c5ea0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-09-17  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        math: Avoid macro redefinition warnings on MSVC.
index 68e5fec31b900643415d1ff7d117719c2711df77..3c332791bbebcfa1f65f4f11d0227e5dde1a56ae 100644 (file)
 #include <string.h>
 #include <unistd.h>
 
-#if HAVE_GNU_LD
+#if _LIBC
+# if HAVE_GNU_LD
 # define environ __environ
-#else
+# else
 extern char **environ;
+# endif
 #endif
 
 #if _LIBC
index 90de697e0d3eb81268bc39138294c66a339918b8..e3fb8c6b96ddd1691e78bf7ed8c713840f6b9664 100644 (file)
@@ -75,7 +75,8 @@
 #endif
 
 /* mingw fails to declare _exit in <unistd.h>.  */
-/* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>.  */
+/* mingw, MSVC, BeOS, Haiku declare environ in <stdlib.h>, not in
+   <unistd.h>.  */
 /* Solaris declares getcwd not only in <unistd.h> but also in <stdlib.h>.  */
 /* But avoid namespace pollution on glibc systems.  */
 #ifndef __GLIBC__
index 7476af11aee84455b2fac7fa46f99f5082088bc9..3321a5e95f5a4dd502f240d117a6ca38b34993f7 100644 (file)
@@ -7,6 +7,7 @@ m4/putenv.m4
 
 Depends-on:
 stdlib
+environ         [test $REPLACE_PUTENV = 1]
 malloc-posix    [test $REPLACE_PUTENV = 1]
 
 configure.ac: