浏览代码

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.
Nick Mathewson 14 年之前
父节点
当前提交
5c09431cc7
共有 2 个文件被更改,包括 5 次插入1 次删除
  1. 4 0
      changes/bug2313
  2. 1 1
      src/common/compat.h

+ 4 - 0
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.

+ 1 - 1
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>