* Re: /srv/bzr/emacs/trunk r109685: Rely on <unistd.h> to declare 'environ'
[not found] <mailman.445588.1345421843.854.emacs-diffs@gnu.org>
@ 2012-08-20 2:54 ` Eli Zaretskii
2012-08-20 4:05 ` Paul Eggert
0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2012-08-20 2:54 UTC (permalink / raw)
To: Paul Eggert; +Cc: emacs-devel
These parts of your changes seem to be wrong, or at least
under-documented in ChangeLog: the Windows build does not use
lib/unistd.h. Why did you make them?
=== modified file 'src/callproc.c'
--- a/src/callproc.c 2012-08-04 14:17:10 +0000
+++ b/src/callproc.c 2012-08-19 21:00:09 +0000
@@ -65,10 +65,6 @@
#include "nsterm.h"
#endif
-#ifndef USE_CRT_DLL
-extern char **environ;
-#endif
-
#ifdef HAVE_SETPGID
#if !defined (USG)
#undef setpgrp
=== modified file 'src/editfns.c'
--- a/src/editfns.c 2012-08-18 06:06:39 +0000
+++ b/src/editfns.c 2012-08-19 21:00:09 +0000
@@ -58,10 +58,6 @@
#include "window.h"
#include "blockinput.h"
-#ifndef USE_CRT_DLL
-extern char **environ;
-#endif
-
#define TM_YEAR_BASE 1900
#ifdef WINDOWSNT
=== modified file 'src/emacs.c'
--- a/src/emacs.c 2012-08-05 21:44:21 +0000
+++ b/src/emacs.c 2012-08-19 21:00:09 +0000
@@ -642,10 +642,6 @@
static void
malloc_initialize_hook (void)
{
-#ifndef USE_CRT_DLL
- extern char **environ;
-#endif
-
if (initialized)
{
if (!malloc_using_checking)
=== modified file 'src/process.c'
--- a/src/process.c 2012-08-18 06:06:39 +0000
+++ b/src/process.c 2012-08-19 21:00:09 +0000
@@ -1623,9 +1623,6 @@
/* 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;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: /srv/bzr/emacs/trunk r109685: Rely on <unistd.h> to declare 'environ'
2012-08-20 2:54 ` /srv/bzr/emacs/trunk r109685: Rely on <unistd.h> to declare 'environ' Eli Zaretskii
@ 2012-08-20 4:05 ` Paul Eggert
2012-08-20 16:49 ` Eli Zaretskii
0 siblings, 1 reply; 3+ messages in thread
From: Paul Eggert @ 2012-08-20 4:05 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
On 08/19/2012 07:54 PM, Eli Zaretskii wrote:
> These parts of your changes seem to be wrong, or at least
> under-documented in ChangeLog: the Windows build does not use
> lib/unistd.h.
On Windows, as I understand it, the system declares
'environ', so gnulib doesn't need to do anything special.
I'm getting this info from gnulib's unistd.h file.
It says that on Windows 'environ' is declared by
stdlib.h. But Emacs's config.h includes stdlib.h, so
'environ' is always visible.
I tried to clarify this by editing the ChangeLog in
trunk bzr 109688.
If my understanding is wrong, my apologies, but the
point is that the main code should be able to assume that
"#include <config.h>" followed by "#include <unistd.h>"
declares 'environ', and if my analysis is incorrect and
that's not the case then I suggest adding
'extern char **environ;' to nt/inc/unistd.h.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: /srv/bzr/emacs/trunk r109685: Rely on <unistd.h> to declare 'environ'
2012-08-20 4:05 ` Paul Eggert
@ 2012-08-20 16:49 ` Eli Zaretskii
0 siblings, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2012-08-20 16:49 UTC (permalink / raw)
To: Paul Eggert; +Cc: emacs-devel
> Date: Sun, 19 Aug 2012 21:05:47 -0700
> From: Paul Eggert <eggert@cs.ucla.edu>
> CC: emacs-devel@gnu.org
>
> On 08/19/2012 07:54 PM, Eli Zaretskii wrote:
> > These parts of your changes seem to be wrong, or at least
> > under-documented in ChangeLog: the Windows build does not use
> > lib/unistd.h.
>
> On Windows, as I understand it, the system declares
> 'environ', so gnulib doesn't need to do anything special.
>
> I'm getting this info from gnulib's unistd.h file.
> It says that on Windows 'environ' is declared by
> stdlib.h. But Emacs's config.h includes stdlib.h, so
> 'environ' is always visible.
>
> I tried to clarify this by editing the ChangeLog in
> trunk bzr 109688.
Thanks.
> If my understanding is wrong, my apologies, but the
> point is that the main code should be able to assume that
> "#include <config.h>" followed by "#include <unistd.h>"
> declares 'environ', and if my analysis is incorrect and
> that's not the case then I suggest adding
> 'extern char **environ;' to nt/inc/unistd.h.
No, your analysis is valid. I added some additional clarifications in
ChangeLog and conf_post.h.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-08-20 16:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mailman.445588.1345421843.854.emacs-diffs@gnu.org>
2012-08-20 2:54 ` /srv/bzr/emacs/trunk r109685: Rely on <unistd.h> to declare 'environ' Eli Zaretskii
2012-08-20 4:05 ` Paul Eggert
2012-08-20 16:49 ` Eli Zaretskii
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).