git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Torsten Bögershausen" <tboegi@web.de>
Cc: Benoit Sigoure <tsunanet@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH] Fix compilation on OS X.
Date: Sat, 20 Jul 2013 22:53:36 -0700	[thread overview]
Message-ID: <7vr4essbkv.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <51EA7D58.3050800@web.de> ("Torsten Bögershausen"'s message of "Sat, 20 Jul 2013 14:06:48 +0200")

Torsten Bögershausen <tboegi@web.de> writes:

> On 2013-07-20 09.49, Benoit Sigoure wrote:
>> +#ifdef __APPLE__
>> +// On OS X libc headers don't define this symbol.
>> +extern char **environ;
>> +#endif
>> +
> A more generic approach could be:
>
> In the file "config.mak.uname": Define a variable in the Darwin section like this
> NO_EXT_ENVIRON = UnfortunatelyYes

Actually, it is _wrong_ for us to rely on system header files to
define this symbol for us.  Declaring "extern char **environ" is
responsibility of the user programs (like us).

When _GNU_SOURCE is defined glibc header (I think it is unistd.h)
seem to define it for us.

Perhaps the correct fix is to revert ec535cc2 for everybody, and if
MinGW needs such a workaround, do it inside #ifndef MINGW?

  parent reply	other threads:[~2013-07-21  5:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-20  7:49 [PATCH] Fix compilation on OS X Benoit Sigoure
2013-07-20  7:55 ` Ramkumar Ramachandra
2013-07-20  7:56   ` tsuna
2013-07-20 12:06 ` Torsten Bögershausen
2013-07-20 18:41   ` Benoit Sigoure
2013-07-21  5:53   ` Junio C Hamano [this message]
2013-07-21  6:10     ` tsuna
2013-07-21  6:17     ` [PATCH] Revert "compat/unsetenv.c: Fix a sparse warning" Benoit Sigoure
2013-07-21 19:54       ` Benoit Sigoure
2013-07-21 22:09         ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vr4essbkv.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=tboegi@web.de \
    --cc=tsunanet@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).