summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-01-03 12:42:19 -0500
committerNick Mathewson <nickm@torproject.org>2011-01-03 12:45:13 -0500
commit5c09431cc7c3843a26b2fcc8e52f56f3bba8abb6 (patch)
treef8e370c969ae99a1de63ed9576984d153d037c25
parent989db9aed19f0ca3c93a1638bab4a2b473a94aa9 (diff)
downloadtor-5c09431cc7c3843a26b2fcc8e52f56f3bba8abb6.tar.gz
tor-5c09431cc7c3843a26b2fcc8e52f56f3bba8abb6.zip
Never include pthread.h when building for Windows.
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.
-rw-r--r--changes/bug23134
-rw-r--r--src/common/compat.h2
2 files changed, 5 insertions, 1 deletions
diff --git a/changes/bug2313 b/changes/bug2313
new file mode 100644
index 0000000000..0ffbe4ab07
--- /dev/null
+++ b/changes/bug2313
@@ -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.
diff --git a/src/common/compat.h b/src/common/compat.h
index f1d869adfa..c7ed32b0d8 100644
--- a/src/common/compat.h
+++ b/src/common/compat.h
@@ -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>