In gnulib, following many Unix systems, environ is declared in <unistd.h>.
There is no need to explicitly include <stdlib.h> in order to get it.
I'm applying this:


2008-12-16  Bruno Haible  <br...@clisp.org>

        * lib/unistd.in.h: Add comment.
        * tests/test-environ.c: Don't include <stdlib.h>.

--- lib/unistd.in.h.orig        2008-12-17 01:51:46.000000000 +0100
+++ lib/unistd.in.h     2008-12-17 01:51:14.000000000 +0100
@@ -35,6 +35,7 @@
 #endif
 
 /* mingw fails to declare _exit in <unistd.h>.  */
+/* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>.  */
 #include <stdlib.h>
 
 #if @GNULIB_WRITE@ && @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@
--- tests/test-environ.c.orig   2008-12-17 01:51:46.000000000 +0100
+++ tests/test-environ.c        2008-12-17 00:08:11.000000000 +0100
@@ -20,7 +20,6 @@
 
 #include <unistd.h>
 
-#include <stdlib.h>
 #include <string.h>
 
 int


Reply via email to