]> code.delx.au - gnu-emacs/commitdiff
Rely on <unistd.h> to declare 'environ',
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 19 Aug 2012 21:00:09 +0000 (14:00 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 19 Aug 2012 21:00:09 +0000 (14:00 -0700)
as gnulib does this if the system doesn't.
* lib-src/emacsclient.c (environ): Remove decl.
* src/callproc.c, src/editfns.c, src/process.c (environ) [!USE_CRT_DLL]:
* src/emacs.c (environ) [DOUG_LEA_MALLOC]:
* src/vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
* src/vm-limit.c: Include <unistd.h>, for 'environ'.

lib-src/ChangeLog
lib-src/emacsclient.c
src/ChangeLog
src/callproc.c
src/editfns.c
src/emacs.c
src/process.c
src/vm-limit.c

index fe90917a70b696e0ff18b6bf76695464de17f54d..464b9e373592dfe6b585dc363785c475e2013666 100644 (file)
@@ -1,3 +1,8 @@
+2012-08-19  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Rely on <unistd.h> to declare 'environ'.
+       * emacsclient.c (environ): Remove decl.
+
 2012-08-17  Juanma Barranquero  <lekktu@gmail.com>
 
        * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
index 20afe1cad117bc5382fb4c4be97bff330535a41d..07300dbf2494cbc616a3f96c113b33488c3f9b25 100644 (file)
@@ -1584,11 +1584,6 @@ main (int argc, char **argv)
   /* Send over our environment and current directory. */
   if (!current_frame)
     {
-#ifndef WINDOWSNT
-      /* This is defined in stdlib.h on MS-Windows.  It's defined in
-        unistd.h on some POSIX hosts, but not all (Bug#10155).  */
-      extern char **environ;
-#endif
       int i;
       for (i = 0; environ[i]; i++)
         {
index e922ede7a0cf984d4909de481e037c0df4ec767b..fa3eaa281d74c1e9b880f10b2425dace6a8ebd56 100644 (file)
@@ -1,5 +1,12 @@
 2012-08-19  Paul Eggert  <eggert@cs.ucla.edu>
 
+       Rely on <unistd.h> to declare 'environ',
+       as gnulib does this if the system doesn't.
+       * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
+       * emacs.c (environ) [DOUG_LEA_MALLOC]:
+       * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
+       * vm-limit.c: Include <unistd.h>, for 'environ'.
+
        * unexaix.c, unexcoff.c: Include "mem-limits.h".
        (start_of_data): Remove decl; mem-limits.h provides it.
 
index 10a80168fb2f7670c18ad621b3a906f490454592..4bf1da04e1acde0eda4a916482eba8ce26a3b990 100644 (file)
@@ -65,10 +65,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "nsterm.h"
 #endif
 
-#ifndef USE_CRT_DLL
-extern char **environ;
-#endif
-
 #ifdef HAVE_SETPGID
 #if !defined (USG)
 #undef setpgrp
index c4725aa0ff37ae0b838442fa164c54fb6681c670..fa57edead28735309c72866a722d266cdade5367 100644 (file)
@@ -58,10 +58,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "window.h"
 #include "blockinput.h"
 
-#ifndef USE_CRT_DLL
-extern char **environ;
-#endif
-
 #define TM_YEAR_BASE 1900
 
 #ifdef WINDOWSNT
index 8d458c612ccc1d16500353273e1985df704e9a2c..9e7efcabbf7dba0bb6260aabbccc7c27f07fbcab 100644 (file)
@@ -642,10 +642,6 @@ argmatch (char **argv, int argc, const char *sstr, const char *lstr,
 static void
 malloc_initialize_hook (void)
 {
-#ifndef USE_CRT_DLL
-  extern char **environ;
-#endif
-
   if (initialized)
     {
       if (!malloc_using_checking)
index ea463cd91872638190d80f7e418cd01ed65b771d..7f6f6bafbeab62d02329dd63b8b4127336d6cff5 100644 (file)
@@ -1623,9 +1623,6 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
   /* Use volatile to protect variables from being clobbered by longjmp.  */
   volatile int forkin, forkout;
   volatile int pty_flag = 0;
-#ifndef USE_CRT_DLL
-  extern char **environ;
-#endif
 
   inchannel = outchannel = -1;
 
index c313a900f2c6d87c4f39d417852f89ab331d5f5d..cf697b56fdfc24b781a5354d46edc2876ac89fdf 100644 (file)
@@ -18,6 +18,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 #include <setjmp.h>
+#include <unistd.h> /* for 'environ', on AIX */
 #include "lisp.h"
 #include "mem-limits.h"
 
@@ -268,7 +269,6 @@ start_of_data (void)
    * is known to live at or near the start of the system crt0.c, and
    * we don't sweat the handful of bytes that might lose.
    */
-  extern char **environ;
   return ((POINTER) &environ);
 #else
   extern int data_start;