Thread (5 messages) flat view 5 messages, 3 authors, 2016-06-15

Re: [PATCH] Fix compilation on OS X.

From: Torsten Bögershausen <hidden>
Date: 2016-06-15 22:58:13

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

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help