git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Fix compilation on OS X.

From
Torsten Bögershausen <tboegi@web.de>
Date
Jul 20, 2013, 12:06 UTC
Message-ID
<51EA7D58.3050800@web.de>
In-Reply-To
<1374306567-16640-1-git-send-email-tsunanet@gmail.com>
On 2013-07-20 09.49, Benoit Sigoure wrote:
Show 5 quoted lines
> +#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

In "Makefile", pick it up, and convert it into a compiler option:
ifdef NO_EXT_ENVIRON
	BASIC_CFLAGS += -DNO_EXT_ENVIRON
endif

And in "git-compat-util.h", add these lines "at a good place": #ifdef NO_EXT_ENVIRON extern char **environ; #endif

This will allow other OS to use the NO_EXT_ENVIRON when needed,.

Thanks for working on this. /Torsten

Previous: tsunaNext: Benoit Sigoure
Message 4 of 10 in “Fix compilation on OS X.”
  1. Fix compilation on OS X.Benoit Sigoure, Jul 20, 2013
  2. Ramkumar RamachandraJul 20, 2013
  3. tsunaJul 20, 2013
  4. Torsten BögershausenJul 20, 2013
  5. Fix compilation on OS X.Benoit Sigoure, Jul 20, 2013
  6. Junio C HamanoJul 21, 2013
  7. tsunaJul 21, 2013
  8. Revert "compat/unsetenv.c: Fix a sparse warning"Benoit Sigoure, Jul 21, 2013
  9. Revert "compat/unsetenv.c: Fix a sparse warning"Benoit Sigoure, Jul 21, 2013
  10. Junio C HamanoJul 21, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.