aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 fe90917a70..464b9e3735 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,8 @@
+2012-08-19 Paul Eggert <[email protected]>
+
+ Rely on <unistd.h> to declare 'environ'.
+ * emacsclient.c (environ): Remove decl.
+
2012-08-17 Juanma Barranquero <[email protected]>
* makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 20afe1cad1..07300dbf24 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -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++)
{
diff --git a/src/ChangeLog b/src/ChangeLog
index e922ede7a0..fa3eaa281d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,12 @@
2012-08-19 Paul Eggert <[email protected]>
+ 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.
diff --git a/src/callproc.c b/src/callproc.c
index 10a80168fb..4bf1da04e1 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/>. */
#include "nsterm.h"
#endif
-#ifndef USE_CRT_DLL
-extern char **environ;
-#endif
-
#ifdef HAVE_SETPGID
#if !defined (USG)
#undef setpgrp
diff --git a/src/editfns.c b/src/editfns.c
index c4725aa0ff..fa57edead2 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/>. */
#include "window.h"
#include "blockinput.h"
-#ifndef USE_CRT_DLL
-extern char **environ;
-#endif
-
#define TM_YEAR_BASE 1900
#ifdef WINDOWSNT
diff --git a/src/emacs.c b/src/emacs.c
index 8d458c612c..9e7efcabbf 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -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)
diff --git a/src/process.c b/src/process.c
index ea463cd918..7f6f6bafbe 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)
/* 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;
diff --git a/src/vm-limit.c b/src/vm-limit.c
index c313a900f2..cf697b56fd 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/>. */
#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;