unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* OSX breakage
@ 2011-11-28 15:36 Mario Lassnig
  2011-11-28 16:48 ` Paul Eggert
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Mario Lassnig @ 2011-11-28 15:36 UTC (permalink / raw)
  To: emacs-devel

Hi,

the recent revno 106533 broke compilation on OSX Lion for me, because 
environ is not defined in unistd.h (possibly this is the case for 
previous versions of OSX as well).


The remedy (to include at the appropriate time and place):

#include <crt_externs.h>
#define environ (*_NSGetEnviron())

Thanks,
Mario



^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: OSX breakage
@ 2011-11-28 18:35 Mario Lassnig
  0 siblings, 0 replies; 11+ messages in thread
From: Mario Lassnig @ 2011-11-28 18:35 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1056 bytes --]

>>/  Date: Mon, 28 Nov 2011 16:36:25 +0100/
>>/  From: Mario Lassnig<address@hidden>/
>>/  /
>>/  The remedy (to include at the appropriate time and place):/
>>/  /
>>/  #include<crt_externs.h>/
>>/  #define environ (*_NSGetEnviron())/

>Is there really no system header on OS X that declares `environ'?  I'm
>surprised.

That's correct. And even system headers do it like this, probably
there's some magic in the background to work with ns-dragndrop and the likes.

Mario@shodan:/usr/include$ grep -r " environ " *
X11/Xw32defs.h:#  define environ     _environ
apache2/modperl_perl_includes.h:#   define environ (*_NSGetEnviron())
architecture/i386/fpu.h: *     #define environ (*_NSGetEnviron())

>If there really isn't, and we need to use #ifdef, I'm inclined to use
>"extern char **environ;".  What would be a MAC OS X specific symbol to
>use with such an ifdef?

That would be

#ifdef __APPLE__


Thanks,
Mario

-- 
Mario Lassnig
CERN PH-ADP-DDM 1-R-022
CH-1211 Geneve 23
mario.lassnig@cern.ch
+41 22 76 71268



[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4394 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-11-30 15:00 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-28 15:36 OSX breakage Mario Lassnig
2011-11-28 16:48 ` Paul Eggert
2011-11-28 17:47 ` Eli Zaretskii
2011-11-28 19:00   ` Paul Eggert
2011-11-29  5:00     ` Chong Yidong
2011-11-29  9:27       ` Paul Eggert
2011-11-28 19:29   ` Randal L. Schwartz
2011-11-29 11:45 ` Ashish SHUKLA
2011-11-30 12:08   ` Carsten Mattner
2011-11-30 15:00   ` Ashish SHUKLA
  -- strict thread matches above, loose matches on Subject: below --
2011-11-28 18:35 Mario Lassnig

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).