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

[PATCH] Fix compilation on OS X.

From: Benoit Sigoure <hidden>
Date: 2016-06-15 22:58:13
Subsystem: the rest · Maintainer: Linus Torvalds

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/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 char **environ;
+#endif
+
 void gitunsetenv (const char *name)
 {
      int src, dst;
-- 
1.8.2.1.539.g4196a96
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help