]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Never include pthread.h when building for Windows.
authorNick Mathewson <nickm@torproject.org>
Mon, 3 Jan 2011 17:42:19 +0000 (12:42 -0500)
committerNick Mathewson <nickm@torproject.org>
Mon, 3 Jan 2011 17:45:13 +0000 (12:45 -0500)
On Windows, we never use pthreads, since it doesn't usually exist,
and when it does it tends to be a little weirdly-behaved.  But some
mingw installations have a pthreads installed, so autoconf detects
pthread.h and tells us about it.  This would make us include
pthread.h, which could make for trouble when the iffy pthread.h
tried to include config.h.

This patch changes compat.h so that we never include pthread.h on
Windows.  Fixes bug 2313; bugfix on 0.1.0.1-rc.

changes/bug2313 [new file with mode: 0644]
src/common/compat.h

diff --git a/changes/bug2313 b/changes/bug2313
new file mode 100644 (file)
index 0000000..0ffbe4a
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor bugfixes
+    - Fix compilation on mingw when a pthreads compatibility library
+      has been installed.  (We don't want to use it, so we shouldn't
+      be including pthread.h.)  Fixes bug 2313; bugfix on 0.1.0.1-rc.
index f1d869adfaa6c25c9c27a51399b0442c1ec7ba0b..c7ed32b0d8a64bf34472868a9ea6f2295ea02619 100644 (file)
@@ -31,7 +31,7 @@
 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif
-#ifdef HAVE_PTHREAD_H
+#if defined(HAVE_PTHREAD_H) && !defined(MS_WINDOWS)
 #include <pthread.h>
 #endif
 #include <stdarg.h>