aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2012-08-19 14:00:09 -0700
committerPaul Eggert2012-08-19 14:00:09 -0700
commitb69a6d228467365b4ed2545dcb1ecc3582d20e2a (patch)
tree012d86b0c224f8c0f6666ad5efa4977d4d6f3281
parent22d7feb28c95cec0c940fc7b933491550730512b (diff)
downloademacs-b69a6d228467365b4ed2545dcb1ecc3582d20e2a.tar.gz
emacs-b69a6d228467365b4ed2545dcb1ecc3582d20e2a.zip
Rely on <unistd.h> to declare 'environ',
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'.
-rw-r--r--lib-src/ChangeLog5
-rw-r--r--lib-src/emacsclient.c5
-rw-r--r--src/ChangeLog7
-rw-r--r--src/callproc.c4
-rw-r--r--src/editfns.c4
-rw-r--r--src/emacs.c4
-rw-r--r--src/process.c3
-rw-r--r--src/vm-limit.c2
8 files changed, 13 insertions, 21 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index fe90917a70b..464b9e37359 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,8 @@
12012-08-19 Paul Eggert <eggert@cs.ucla.edu>
2
3 Rely on <unistd.h> to declare 'environ'.
4 * emacsclient.c (environ): Remove decl.
5
12012-08-17 Juanma Barranquero <lekktu@gmail.com> 62012-08-17 Juanma Barranquero <lekktu@gmail.com>
2 7
3 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies. 8 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 20afe1cad11..07300dbf249 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -1584,11 +1584,6 @@ main (int argc, char **argv)
1584 /* Send over our environment and current directory. */ 1584 /* Send over our environment and current directory. */
1585 if (!current_frame) 1585 if (!current_frame)
1586 { 1586 {
1587#ifndef WINDOWSNT
1588 /* This is defined in stdlib.h on MS-Windows. It's defined in
1589 unistd.h on some POSIX hosts, but not all (Bug#10155). */
1590 extern char **environ;
1591#endif
1592 int i; 1587 int i;
1593 for (i = 0; environ[i]; i++) 1588 for (i = 0; environ[i]; i++)
1594 { 1589 {
diff --git a/src/ChangeLog b/src/ChangeLog
index e922ede7a0c..fa3eaa281d7 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,12 @@
12012-08-19 Paul Eggert <eggert@cs.ucla.edu> 12012-08-19 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 Rely on <unistd.h> to declare 'environ',
4 as gnulib does this if the system doesn't.
5 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
6 * emacs.c (environ) [DOUG_LEA_MALLOC]:
7 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
8 * vm-limit.c: Include <unistd.h>, for 'environ'.
9
3 * unexaix.c, unexcoff.c: Include "mem-limits.h". 10 * unexaix.c, unexcoff.c: Include "mem-limits.h".
4 (start_of_data): Remove decl; mem-limits.h provides it. 11 (start_of_data): Remove decl; mem-limits.h provides it.
5 12
diff --git a/src/callproc.c b/src/callproc.c
index 10a80168fb2..4bf1da04e1a 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -65,10 +65,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
65#include "nsterm.h" 65#include "nsterm.h"
66#endif 66#endif
67 67
68#ifndef USE_CRT_DLL
69extern char **environ;
70#endif
71
72#ifdef HAVE_SETPGID 68#ifdef HAVE_SETPGID
73#if !defined (USG) 69#if !defined (USG)
74#undef setpgrp 70#undef setpgrp
diff --git a/src/editfns.c b/src/editfns.c
index c4725aa0ff3..fa57edead28 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -58,10 +58,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
58#include "window.h" 58#include "window.h"
59#include "blockinput.h" 59#include "blockinput.h"
60 60
61#ifndef USE_CRT_DLL
62extern char **environ;
63#endif
64
65#define TM_YEAR_BASE 1900 61#define TM_YEAR_BASE 1900
66 62
67#ifdef WINDOWSNT 63#ifdef WINDOWSNT
diff --git a/src/emacs.c b/src/emacs.c
index 8d458c612cc..9e7efcabbf7 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -642,10 +642,6 @@ argmatch (char **argv, int argc, const char *sstr, const char *lstr,
642static void 642static void
643malloc_initialize_hook (void) 643malloc_initialize_hook (void)
644{ 644{
645#ifndef USE_CRT_DLL
646 extern char **environ;
647#endif
648
649 if (initialized) 645 if (initialized)
650 { 646 {
651 if (!malloc_using_checking) 647 if (!malloc_using_checking)
diff --git a/src/process.c b/src/process.c
index ea463cd9187..7f6f6bafbea 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1623,9 +1623,6 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
1623 /* Use volatile to protect variables from being clobbered by longjmp. */ 1623 /* Use volatile to protect variables from being clobbered by longjmp. */
1624 volatile int forkin, forkout; 1624 volatile int forkin, forkout;
1625 volatile int pty_flag = 0; 1625 volatile int pty_flag = 0;
1626#ifndef USE_CRT_DLL
1627 extern char **environ;
1628#endif
1629 1626
1630 inchannel = outchannel = -1; 1627 inchannel = outchannel = -1;
1631 1628
diff --git a/src/vm-limit.c b/src/vm-limit.c
index c313a900f2c..cf697b56fdf 100644
--- a/src/vm-limit.c
+++ b/src/vm-limit.c
@@ -18,6 +18,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
18 18
19#include <config.h> 19#include <config.h>
20#include <setjmp.h> 20#include <setjmp.h>
21#include <unistd.h> /* for 'environ', on AIX */
21#include "lisp.h" 22#include "lisp.h"
22#include "mem-limits.h" 23#include "mem-limits.h"
23 24
@@ -268,7 +269,6 @@ start_of_data (void)
268 * is known to live at or near the start of the system crt0.c, and 269 * is known to live at or near the start of the system crt0.c, and
269 * we don't sweat the handful of bytes that might lose. 270 * we don't sweat the handful of bytes that might lose.
270 */ 271 */
271 extern char **environ;
272 return ((POINTER) &environ); 272 return ((POINTER) &environ);
273#else 273#else
274 extern int data_start; 274 extern int data_start;