]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix headers in test for whether environ is declared in stdlib/unistd
authorNick Mathewson <nickm@torproject.org>
Mon, 30 Apr 2012 16:48:33 +0000 (12:48 -0400)
committerNick Mathewson <nickm@torproject.org>
Mon, 30 Apr 2012 16:48:33 +0000 (12:48 -0400)
We'd had our configure.in test include unistd.h unconditionally,
which would fail on Windows/mingw, even though environ _was_
declared there.  Fix for 5704; bugfix on 0.2.3.13-alpha.

Thanks to Erinn for finding this and rransom for figuring out the
problem.

changes/bug5704 [new file with mode: 0644]
configure.in

diff --git a/changes/bug5704 b/changes/bug5704
new file mode 100644 (file)
index 0000000..40afefb
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor bugfixes:
+    - Fix compilation on platforms without unistd.h, or where environ
+      is defined in stdlib.h. Fixes bug 5704; bugfix on
+      0.2.3.13-alpha.
\ No newline at end of file
index e6f379c23d10b79d162dcf1cd52682c1efee2a1c..d4ea6c6d15ae3789f29095c82c5986830e8055c3 100644 (file)
@@ -1116,7 +1116,10 @@ AC_CACHE_CHECK([whether we have extern char **environ already declared],
 /* We define _GNU_SOURCE here because it is also defined in compat.c.
  * Without it environ doesn't get declared. */
 #define _GNU_SOURCE
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
+#include <stdlib.h>
 int main(int c, char **v) { char **t = environ; }])],
   tor_cv_have_environ_declared=yes,
   tor_cv_have_environ_declared=no))