pthreads-w32: Add patch for newer mingw-w64 versions
authorAndre Heinecke <aheinecke@intevation.de>
Thu, 18 Apr 2013 16:46:05 +0000 (16:46 +0000)
committerWerner Koch <wk@gnupg.org>
Wed, 24 Apr 2013 19:05:18 +0000 (21:05 +0200)
* Makefile.am: Add patch to EXTRA_DIST
* patches/pthreads-w32-2-8-0-release: Add
02-mingw_w64_timespec_compatibility.patch
--
The mingw-w64 header included in debian sid define timespec in time.h
for windows. As pthread has not a configurable build system we check
for a definition made by the header instead of checking for the
struct.

(cherry picked from commit 3e813b391bf77b91b4492aafc5c8f136a60d535f)

Makefile.am
patches/pthreads-w32-2-8-0-release/02-mingw_w64_timespec_compatibility.patch [new file with mode: 0755]

index b638f42..433cd16 100644 (file)
@@ -25,6 +25,7 @@ SUBDIRS = po packages include doc src
 EXTRA_DIST = autogen.sh README.GIT ONEWS \
         build-aux/git-log-footer build-aux/git-log-fix \
         patches/pthreads-w32-2-8-0-release/01-make.patch \
+ patches/pthreads-w32-2-8-0-release/02-mingw_w64_timespec_compatibility.patch \
         patches/glib-2.12.12/01-giowin32.patch \
         patches/glib-2.12.12/02-gspawn-w32.patch \
         patches/glib-2.12.12/03-gspawn-w32-fixup.patch \
diff --git a/patches/pthreads-w32-2-8-0-release/02-mingw_w64_timespec_compatibility.patch b/patches/pthreads-w32-2-8-0-release/02-mingw_w64_timespec_compatibility.patch
new file mode 100755 (executable)
index 0000000..cc83013
--- /dev/null
@@ -0,0 +1,34 @@
+#! /bin/sh
+# Ignore whitespace is necessary because the original context of the patch
+# contains whitespace errors
+patch -p0 -f --ignore-whitespace $* < $0
+exit $?
+
+2013-04-18  Andre Heinecke  <aheinecke@intevation.de>
+
+       * pthread.h: Handle that struct timespec might be defined
+    on windows without _UWIN definition.
+
+--- pthread.h.orig      2013-04-18 15:52:11.470656381 +0000
++++ pthread.h   2013-04-18 15:52:14.762630601 +0000
+@@ -110,7 +110,6 @@
+ #endif
+
+ #ifdef _UWIN
+-#   define HAVE_STRUCT_TIMESPEC 1
+ #   define HAVE_SIGNAL_H        1
+ #   undef HAVE_CONFIG_H
+ #   pragma comment(lib, "pthread")
+@@ -227,6 +226,12 @@
+ #include <setjmp.h>
+ #include <limits.h>
+
++// Check if someone defined timespec
++#if defined(_UWIN) || defined(_TIMESPEC_DEFINED)
++#   define HAVE_STRUCT_TIMESPEC 1
++#endif
++
++
+ /*
+  * Boolean values to make us independent of system includes.
+  */