Re: [PATCH] Fix compilation on OS X.

2013-07-20 Thread tsuna
On Sat, Jul 20, 2013 at 10:53 PM, Junio C Hamano wrote: > 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). Actually, that's right. The C99 standard doesn't mention

Re: [PATCH] Fix compilation on OS X.

2013-07-20 Thread Junio C Hamano
Torsten Bögershausen 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 s

[PATCH] Fix compilation on OS X.

2013-07-20 Thread Benoit Sigoure
On OS X libc headers don't define `environ', and since ec535cc2 removed the redundant declaration this code no longer builds on OS X. --- Makefile | 5 + config.mak.uname | 1 + git-compat-util.h | 4 3 files changed, 10 insertions(+) diff --git a/Makefile b/Makefile index 0600

Re: [PATCH] Fix compilation on OS X.

2013-07-20 Thread Torsten Bögershausen
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 = Unfortun

Re: [PATCH] Fix compilation on OS X.

2013-07-20 Thread tsuna
On Sat, Jul 20, 2013 at 12:55 AM, Ramkumar Ramachandra wrote: > Benoit Sigoure wrote: >> diff --git a/compat/unsetenv.c b/compat/unsetenv.c >> index 4ea1856..addf3dc 100644 >> --- a/compat/unsetenv.c >> +++ b/compat/unsetenv.c >> @@ -1,5 +1,10 @@ >> #include "../git-compat-util.h" >> >> +#ifdef _

Re: [PATCH] Fix compilation on OS X.

2013-07-20 Thread Ramkumar Ramachandra
Benoit Sigoure wrote: > diff --git a/compat/unsetenv.c b/compat/unsetenv.c > index 4ea1856..addf3dc 100644 > --- a/compat/unsetenv.c > +++ b/compat/unsetenv.c > @@ -1,5 +1,10 @@ > #include "../git-compat-util.h" > > +#ifdef __APPLE__ > +// On OS X libc headers don't define this symbol. > +extern c

[PATCH] Fix compilation on OS X.

2013-07-20 Thread Benoit Sigoure
On OS X libc headers don't define `environ', and since ec535cc2 removed the redundant declaration this code no longer builds on OS X. --- compat/unsetenv.c | 5 + 1 file changed, 5 insertions(+) diff --git a/compat/unsetenv.c b/compat/unsetenv.c index 4ea1856..addf3dc 100644 --- a/compat/unse