LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File pthreads-2.8.0-w64.diff of Package mingw32-pthreads (Project windows:mingw:win32)

--- GNUmakefile	2006-12-21 01:55:28 -0600
+++ GNUmakefile	2008-09-29 18:28:38 -0500
@@ -58,12 +58,12 @@ CXX     = $(CROSS)g++
 RANLIB  = $(CROSS)ranlib
 RC	= $(CROSS)windres
 
-OPT	= $(CLEANUP) -O3 -finline-functions
+OPT	= $(CLEANUP) -O3 -DPTW32_BUILD -D__MINGW32__ -finline-functions
 DOPT	= $(CLEANUP) -g -O0
 XOPT	=
 
 RCFLAGS		= --include-dir=.
-LFLAGS		= -lwsock32
+LFLAGS		= -lws2_32
 
 # ----------------------------------------------------------------------
 # The library can be built with some alternative behaviour to
--- pthread.h	2006-12-21 01:55:28 -0600
+++ pthread.h	2008-09-29 14:13:12 -0500
@@ -109,13 +109,6 @@
 /* Include everything */
 #endif
 
-#ifdef _UWIN
-#   define HAVE_STRUCT_TIMESPEC 1
-#   define HAVE_SIGNAL_H        1
-#   undef HAVE_CONFIG_H
-#   pragma comment(lib, "pthread")
-#endif
-
 /*
  * -------------------------------------------------------------
  *
@@ -204,25 +204,8 @@
  */
 typedef unsigned long DWORD_PTR;
 #endif
-/*
- * -----------------
- * autoconf switches
- * -----------------
- */
-
-#if HAVE_CONFIG_H
-#include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#ifndef NEED_FTIME
-#include <time.h>
-#else /* NEED_FTIME */
-/* use native WIN32 time API */
-#endif /* NEED_FTIME */
 
-#if HAVE_SIGNAL_H
 #include <signal.h>
-#endif /* HAVE_SIGNAL_H */
 
 #include <setjmp.h>
 #include <limits.h>
@@ -238,55 +238,17 @@
   PTW32_TRUE = (! PTW32_FALSE)
 };
 
-/*
- * This is a duplicate of what is in the autoconf config.h,
- * which is only used when building the pthread-win32 libraries.
- */
-
-#ifndef PTW32_CONFIG_H
-#  if defined(WINCE)
-#    define NEED_ERRNO
-#    define NEED_SEM
-#  endif
-#  if defined(_UWIN) || defined(__MINGW32__)
-#    define HAVE_MODE_T
-#  endif
-#endif
-
-/*
- *
- */
-
 #if PTW32_LEVEL >= PTW32_LEVEL_MAX
-#ifdef NEED_ERRNO
-#include "need_errno.h"
-#else
 #include <errno.h>
-#endif
 #endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */
 
 /*
  * Several systems don't define some error numbers.
  */
 #ifndef ENOTSUP
 #  define ENOTSUP 48   /* This is the value in Solaris. */
 #endif
 
-#ifndef ETIMEDOUT
-#  define ETIMEDOUT 10060     /* This is the value in winsock.h. */
-#endif
-
-#ifndef ENOSYS
-#  define ENOSYS 140     /* Semi-arbitrary value */
-#endif
-
-#ifndef EDEADLK
-#  ifdef EDEADLOCK
-#    define EDEADLK EDEADLOCK
-#  else
-#    define EDEADLK 36     /* This is the value in MSVC. */
-#  endif
-#endif
 
 #include <sched.h>
 
@@ -304,13 +304,12 @@ enum {
 #endif
 #endif
 
-#ifndef HAVE_STRUCT_TIMESPEC
-#define HAVE_STRUCT_TIMESPEC 1
+/*
+ * Mingw-w64 has struct timespec but not mingw.org.  Just use a
+ * forward declaration here as that is all that is needed in code
+ * that just includes this header.
+ */
-struct timespec {
-        long tv_sec;
-        long tv_nsec;
-};
+struct timespec;
-#endif /* HAVE_STRUCT_TIMESPEC */
 
 #ifndef SIG_BLOCK
 #define SIG_BLOCK 0
--- sched.h
+++ sched.h
@@ -39,29 +39,29 @@
 #ifndef _SCHED_H
 #define _SCHED_H
 
-#undef PTW32_LEVEL
+#undef PTW32_SCHED_LEVEL
 
 #if defined(_POSIX_SOURCE)
-#define PTW32_LEVEL 0
+#define PTW32_SCHED_LEVEL 0
 /* Early POSIX */
 #endif
 
 #if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199309
-#undef PTW32_LEVEL
-#define PTW32_LEVEL 1
+#undef PTW32_SCHED_LEVEL
+#define PTW32_SCHED_LEVEL 1
 /* Include 1b, 1c and 1d */
 #endif
 
 #if defined(INCLUDE_NP)
-#undef PTW32_LEVEL
-#define PTW32_LEVEL 2
+#undef PTW32_SCHED_LEVEL
+#define PTW32_SCHED_LEVEL 2
 /* Include Non-Portable extensions */
 #endif
 
-#define PTW32_LEVEL_MAX 3
+#define PTW32_SCHED_LEVEL_MAX 3
 
-#if !defined(PTW32_LEVEL)
-#define PTW32_LEVEL PTW32_LEVEL_MAX
+#if !defined(PTW32_SCHED_LEVEL)
+#define PTW32_SCHED_LEVEL PTW32_SCHED_LEVEL_MAX
 /* Include everything */
 #endif
 
@@ -86,40 +86,17 @@
 #  define PTW32_DLLPORT
 #endif
 
-/*
- * This is a duplicate of what is in the autoconf config.h,
- * which is only used when building the pthread-win32 libraries.
- */
-
-#ifndef PTW32_CONFIG_H
-#  if defined(WINCE)
-#    define NEED_ERRNO
-#    define NEED_SEM
-#  endif
-#  if defined(_UWIN) || defined(__MINGW32__)
-#    define HAVE_MODE_T
-#  endif
-#endif
-
-/*
- *
- */
-
-#if PTW32_LEVEL >= PTW32_LEVEL_MAX
-#ifdef NEED_ERRNO
-#include "need_errno.h"
-#else
+#if PTW32_SCHED_LEVEL >= PTW32_SCHED_LEVEL_MAX
 #include <errno.h>
-#endif
-#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */
+#endif /* PTW32_SCHED_LEVEL >= PTW32_SCHED_LEVEL_MAX */
 
 #if defined(__MINGW32__) || defined(_UWIN)
-#if PTW32_LEVEL >= PTW32_LEVEL_MAX
+#if PTW32_SCHED_LEVEL >= PTW32_SCHED_LEVEL_MAX
 /* For pid_t */
 #  include <sys/types.h>
 /* Required by Unix 98 */
 #  include <time.h>
-#endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */
+#endif /* PTW32_SCHED_LEVEL >= PTW32_SCHED_LEVEL_MAX */
 #else
 typedef int pid_t;
 #endif
@@ -171,8 +148,8 @@
 }                               /* End of extern "C" */
 #endif                          /* __cplusplus */
 
-#undef PTW32_LEVEL
-#undef PTW32_LEVEL_MAX
+#undef PTW32_SCHED_LEVEL
+#undef PTW32_SCHED_LEVEL_MAX
 
 #endif                          /* !_SCHED_H */
 
--- tests/GNUmakefile	2006-12-22 11:15:26 -0600
+++ tests/GNUmakefile	2008-09-29 19:37:38 -0500
@@ -51,7 +51,7 @@ MAKE	= make
 #
 XXCFLAGS	= 
 XXLIBS	= -lws2_32
-#CFLAGS	= -O3 -UNDEBUG -Wall $(XXCFLAGS)
+#CFLAGS	= -O3 -D_M_AMD64 -UNDEBUG -Wall $(XXCFLAGS)
 CFLAGS	= -g -UNDEBUG -Wall $(XXCFLAGS)
 BUILD_DIR	= ..
 INCLUDES	= -I.
@@ -69,7 +69,7 @@ LIB	= libpthread$(GCX).a
 DLL	= pthread$(GCX).dll
 QAPC	= ../QueueUserAPCEx/User/quserex.dll
 
-COPYFILES	= $(HDR) $(LIB) $(DLL) $(QAPC)
+COPYFILES	= $(HDR) $(LIB) $(DLL)
 
 # If a test case returns a non-zero exit code to the shell, make will
 # stop.
@@ -327,13 +327,13 @@ sizes.pass: sizes.exe
 	@ $(ECHO) Passed
 	@ $(TOUCH) $@
 
-%.bench: $(LIB) $(DLL) $(HDR) $(QAPC) $(XXLIBS) %.exe
+%.bench: $(LIB) $(DLL) $(HDR)  $(XXLIBS) %.exe
 	@ $(ECHO) Running $*
 	$*
 	@ $(ECHO) Done
 	@ $(TOUCH) $@
 
-%.exe: %.c $(LIB) $(DLL) $(HDR) $(QAPC)
+%.exe: %.c $(LIB) $(DLL) $(HDR)
 	@ $(ECHO) Compiling $@
 	@ $(ECHO) $(CC) $(CFLAGS) -o $@ $< $(INCLUDES) -L. -lpthread$(GCX) -lsupc++ $(XXLIBS)
 	@ $(CC) $(CFLAGS) -o $@ $< $(INCLUDES) -L. -lpthread$(GCX) -lsupc++ $(XXLIBS)
--- tests/barrier3.c	2006-12-21 01:55:30 -0600
+++ tests/barrier3.c	2008-09-29 18:35:26 -0500
@@ -41,7 +41,7 @@
 #include "test.h"
  
 pthread_barrier_t barrier = NULL;
-static int result = 1;
+static DWORD_PTR result = 1;
 
 void * func(void * arg)
 {
--- tests/barrier5.c	2006-12-21 01:55:30 -0600
+++ tests/barrier5.c	2008-09-29 18:37:08 -0500
@@ -90,7 +90,7 @@ int
 main()
 {
   int i, j;
-  int result;
+  DWORD_PTR result;
   int serialThreadsTotal;
   pthread_t t[NUMTHREADS + 1];
 
@@ -112,7 +112,7 @@ main()
       for (i = 1; i <= j; i++)
         {
           assert(pthread_join(t[i], (void **) &result) == 0);
-          serialThreadsTotal += result;
+           serialThreadsTotal += (int)result;
         }
 
       assert(serialThreadsTotal == BARRIERS - 1);
--- tests/cancel2.c	2006-12-21 01:55:30 -0600
+++ tests/cancel2.c	2008-09-29 18:38:24 -0500
@@ -217,7 +217,7 @@ main()
   for (i = 1; i <= NUMTHREADS; i++)
     {
       int fail = 0;
-      int result = 0;
+      DWORD_PTR result = 0;
 
       assert(pthread_join(t[i], (void **) &result) == 0);
       fail = (result != (int) PTHREAD_CANCELED);
--- tests/cancel3.c	2006-12-21 01:55:30 -0600
+++ tests/cancel3.c	2008-09-29 18:39:18 -0500
@@ -173,7 +173,7 @@ main ()
   for (i = 1; i <= NUMTHREADS; i++)
     {
       int fail = 0;
-      int result = 0;
+      DWORD_PTR result = 0;
 
       /*
        * The thread does not contain any cancelation points, so
--- tests/cancel4.c	2006-12-21 01:55:30 -0600
+++ tests/cancel4.c	2008-09-29 18:40:04 -0500
@@ -173,7 +173,7 @@ main()
   for (i = 1; i <= NUMTHREADS; i++)
     {
       int fail = 0;
-      int result = 0;
+      DWORD_PTR result = 0;
 
       /*
        * The thread does not contain any cancelation points, so
--- tests/cancel5.c	2006-12-21 01:55:30 -0600
+++ tests/cancel5.c	2008-09-29 18:40:46 -0500
@@ -171,7 +171,7 @@ main ()
   for (i = 1; i <= NUMTHREADS; i++)
     {
       int fail = 0;
-      int result = 0;
+      DWORD_PTR result = 0;
 
       /*
        * The thread does not contain any cancelation points, so
--- tests/cancel6a.c	2006-12-21 01:55:30 -0600
+++ tests/cancel6a.c	2008-09-29 18:41:28 -0500
@@ -161,7 +161,7 @@ main()
   for (i = 1; i <= NUMTHREADS; i++)
     {
       int fail = 0;
-      int result = 0;
+      DWORD_PTR result = 0;
 
       /*
        * The thread does not contain any cancelation points, so
--- tests/cancel6d.c	2006-12-21 01:55:30 -0600
+++ tests/cancel6d.c	2008-09-29 18:41:54 -0500
@@ -165,7 +165,7 @@ main()
   for (i = 1; i <= NUMTHREADS; i++)
     {
       int fail = 0;
-      int result = 0;
+      DWORD_PTR result = 0;
 
       assert(pthread_join(t[i], (void **) &result) == 0);
 
--- tests/cleanup0.c	2006-12-21 01:55:30 -0600
+++ tests/cleanup0.c	2008-09-29 18:42:58 -0500
@@ -189,7 +189,7 @@ main()
   for (i = 1; i <= NUMTHREADS; i++)
     {
       int fail = 0;
-      int result = 0;
+      DWORD_PTR result = 0;
 
       assert(pthread_join(t[i], (void **) &result) == 0);
 
--- tests/cleanup1.c	2006-12-21 01:55:30 -0600
+++ tests/cleanup1.c	2008-09-29 18:43:34 -0500
@@ -203,7 +203,7 @@ main()
   for (i = 1; i <= NUMTHREADS; i++)
     {
       int fail = 0;
-      int result = 0;
+      DWORD_PTR result = 0;
 
       assert(pthread_join(t[i], (void **) &result) == 0);
 
--- tests/cleanup2.c	2006-12-21 01:55:30 -0600
+++ tests/cleanup2.c	2008-09-29 18:44:04 -0500
@@ -178,7 +178,7 @@ main()
   for (i = 1; i <= NUMTHREADS; i++)
     {
       int fail = 0;
-      int result = 0;
+      DWORD_PTR result = 0;
 
       assert(pthread_join(t[i], (void **) &result) == 0);
 
--- tests/cleanup3.c	2006-12-21 01:55:30 -0600
+++ tests/cleanup3.c	2008-09-29 18:44:36 -0500
@@ -183,7 +183,7 @@ main()
   for (i = 1; i <= NUMTHREADS; i++)
     {
       int fail = 0;
-      int result = 0;
+      DWORD_PTR result = 0;
 
       assert(pthread_join(t[i], (void **) &result) == 0);
 
--- tests/condvar1_2.c	2006-12-21 01:55:30 -0600
+++ tests/condvar1_2.c	2008-09-29 18:45:16 -0500
@@ -89,7 +89,7 @@ int
 main()
 {
   int i, j, k;
-  int result = -1;
+  DWORD_PTR result = -1;
   pthread_t t;
 
   for (k = 0; k < NUM_LOOPS; k++)
--- tests/condvar2.c	2006-12-21 01:55:30 -0600
+++ tests/condvar2.c	2008-09-29 18:47:34 -0500
@@ -99,7 +99,7 @@ main()
   /* get current system time */
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 1;
@@ -109,7 +109,7 @@ main()
   assert(pthread_mutex_unlock(&mutex) == 0);
 
   {
-  int result = pthread_cond_destroy(&cv);
+  DWORD_PTR result = pthread_cond_destroy(&cv);
   if (result != 0)
     {
       fprintf(stderr, "Result = %s\n", error_string[result]);
--- tests/condvar2_1.c	2006-12-21 01:55:30 -0600
+++ tests/condvar2_1.c	2008-09-29 18:49:16 -0500
@@ -105,7 +105,7 @@ main()
 {
   int i;
   pthread_t t[NUMTHREADS + 1];
-  int result = 0;
+  DWORD_PTR result = 0;
   struct _timeb currSysTime;
   const DWORD NANOSEC_PER_MILLISEC = 1000000;
 
@@ -116,7 +116,7 @@ main()
   /* get current system time */
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 5;
--- tests/condvar3.c	2006-12-21 01:55:30 -0600
+++ tests/condvar3.c	2008-09-29 18:50:04 -0500
@@ -126,7 +126,7 @@ main()
   /* get current system time */
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   assert(pthread_create(&t[1], NULL, mythread, (void *) 1) == 0);
--- tests/condvar3_1.c	2006-12-21 01:55:30 -0600
+++ tests/condvar3_1.c	2008-09-29 18:51:50 -0500
@@ -126,7 +126,7 @@ main()
 {
   int i;
   pthread_t t[NUMTHREADS + 1];
-  int result = 0;
+  DWORD_PTR result = 0;
   struct _timeb currSysTime;
   const DWORD NANOSEC_PER_MILLISEC = 1000000;
 
@@ -139,7 +139,7 @@ main()
   /* get current system time */
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 5;
--- tests/condvar3_2.c	2006-12-21 01:55:30 -0600
+++ tests/condvar3_2.c	2008-09-29 18:53:26 -0500
@@ -127,7 +127,7 @@ main()
 {
   int i;
   pthread_t t[NUMTHREADS + 1];
-  int result = 0;
+  DWORD_PTR result = 0;
   struct _timeb currSysTime;
   const DWORD NANOSEC_PER_MILLISEC = 1000000;
 
@@ -138,7 +138,7 @@ main()
   /* get current system time */
   _ftime(&currSysTime);
 
-  abstime.tv_sec = abstime.tv_sec = currSysTime.time + 5;
+  abstime.tv_sec = abstime.tv_sec = (long)currSysTime.time + 5;
   abstime.tv_nsec = abstime2.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   assert(pthread_mutex_lock(&mutex) == 0);
--- tests/condvar3_3.c	2006-12-21 01:55:30 -0600
+++ tests/condvar3_3.c	2008-09-29 18:54:36 -0500
@@ -96,7 +96,7 @@ int main()
    /* get current system time */
    _ftime(&currSysTime);
 
-   abstime.tv_sec = currSysTime.time;
+   abstime.tv_sec = (long)currSysTime.time;
    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
    abstime.tv_sec += 1;
 
@@ -120,7 +120,7 @@ int main()
 
    assert(pthread_mutex_lock(&mtx) == 0);
 
-   abstime.tv_sec = currSysTime.time;
+   abstime.tv_sec = (long)currSysTime.time;
    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
    abstime.tv_sec += 1;
 
--- tests/condvar4.c	2006-12-21 01:55:30 -0600
+++ tests/condvar4.c	2008-09-29 18:56:00 -0500
@@ -130,7 +130,7 @@ main()
   /* get current system time */
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 5;
@@ -143,7 +143,7 @@ main()
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 5;
--- tests/condvar5.c	2006-12-21 01:55:30 -0600
+++ tests/condvar5.c	2008-09-29 18:57:12 -0500
@@ -129,7 +129,7 @@ main()
   /* get current system time */
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 5;
@@ -142,7 +142,7 @@ main()
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 5;
--- tests/condvar6.c	2006-12-21 01:55:30 -0600
+++ tests/condvar6.c	2008-09-29 18:58:00 -0500
@@ -159,7 +159,7 @@ main()
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 5;
--- tests/condvar7.c	2006-12-21 01:55:30 -0600
+++ tests/condvar7.c	2008-09-29 18:58:56 -0500
@@ -169,7 +169,7 @@ main()
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 10;
--- tests/condvar8.c	2006-12-21 01:55:30 -0600
+++ tests/condvar8.c	2008-09-29 18:59:38 -0500
@@ -166,7 +166,7 @@ main()
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 10;
--- tests/condvar9.c	2006-12-21 01:55:30 -0600
+++ tests/condvar9.c	2008-09-29 19:00:22 -0500
@@ -174,7 +174,7 @@ main()
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 5;
--- tests/context1.c	2006-12-21 01:55:30 -0600
+++ tests/context1.c	2008-09-29 19:39:12 -0500
@@ -125,7 +125,11 @@ main()
       /*
        *_x86 only!!!
        */
+#if defined(_M_IX86)
       context.Eip = (DWORD) anotherEnding;
+#else
+      context.Rip = (DWORD64) anotherEnding;
+#endif
       SetThreadContext(hThread, &context);
       ResumeThread(hThread);
     }
--- tests/delay2.c	2006-12-21 01:55:30 -0600
+++ tests/delay2.c	2008-09-29 19:03:26 -0500
@@ -65,7 +65,7 @@ int
 main(int argc, char * argv[])
 {
   pthread_t t;
-  int result = 0;
+  DWORD_PTR result = 0;
 
   assert(pthread_mutex_lock(&mx) == 0);
 
--- tests/exception1.c	2006-12-21 01:55:30 -0600
+++ tests/exception1.c	2008-09-29 19:04:16 -0500
@@ -226,7 +226,7 @@ main()
   for (i = 0; i < NUMTHREADS; i++)
     {
       int fail = 0;
-      int result = 0;
+      DWORD_PTR result = 0;
 
 	/* Canceled thread */
       assert(pthread_join(ct[i], (void **) &result) == 0);
--- tests/join0.c	2006-12-21 01:55:30 -0600
+++ tests/join0.c	2008-09-29 19:04:50 -0500
@@ -53,7 +53,7 @@ int
 main(int argc, char * argv[])
 {
   pthread_t id;
-  int result;
+  DWORD_PTR result;
 
   /* Create a single thread and wait for it to exit. */
   assert(pthread_create(&id, NULL, func, (void *) 123) == 0);
--- tests/join1.c	2006-12-21 01:55:28 -0600
+++ tests/join1.c	2008-09-29 19:05:24 -0500
@@ -56,7 +56,7 @@ main(int argc, char * argv[])
 {
 	pthread_t id[4];
 	int i;
-	int result;
+	DWORD_PTR result;
 
 	/* Create a few threads and then exit. */
 	for (i = 0; i < 4; i++)
--- tests/join2.c	2006-12-21 01:55:30 -0600
+++ tests/join2.c	2008-09-29 19:05:50 -0500
@@ -50,7 +50,7 @@ main(int argc, char * argv[])
 {
 	pthread_t id[4];
 	int i;
-	int result;
+	DWORD_PTR result;
 
 	/* Create a few threads and then exit. */
 	for (i = 0; i < 4; i++)
--- tests/join3.c	2006-12-21 01:55:30 -0600
+++ tests/join3.c	2008-09-29 19:06:22 -0500
@@ -50,7 +50,7 @@ main(int argc, char * argv[])
 {
 	pthread_t id[4];
 	int i;
-	int result;
+	DWORD_PTR result;
 
 	/* Create a few threads and then exit. */
 	for (i = 0; i < 4; i++)
--- tests/mutex6e.c	2006-12-21 01:55:30 -0600
+++ tests/mutex6e.c	2008-09-29 19:07:28 -0500
@@ -74,7 +74,7 @@ int
 main()
 {
   pthread_t t;
-  int result = 0;
+  DWORD_PTR result = 0;
   int mxType = -1;
 
   assert(pthread_mutexattr_init(&mxAttr) == 0);
--- tests/mutex6es.c	2006-12-21 01:55:30 -0600
+++ tests/mutex6es.c	2008-09-29 19:07:52 -0500
@@ -73,7 +73,7 @@ int
 main()
 {
   pthread_t t;
-  int result = 0;
+  DWORD_PTR result = 0;
 
   assert(mutex == PTHREAD_ERRORCHECK_MUTEX_INITIALIZER);
 
--- tests/mutex6r.c	2006-12-21 01:55:30 -0600
+++ tests/mutex6r.c	2008-09-29 19:08:42 -0500
@@ -73,7 +73,7 @@ int
 main()
 {
   pthread_t t;
-  int result = 0;
+  DWORD_PTR result = 0;
   int mxType = -1;
 
   assert(pthread_mutexattr_init(&mxAttr) == 0);
--- tests/mutex6rs.c	2006-12-21 01:55:30 -0600
+++ tests/mutex6rs.c	2008-09-29 19:09:14 -0500
@@ -72,7 +72,7 @@ int
 main()
 {
   pthread_t t;
-  int result = 0;
+  DWORD_PTR result = 0;
 
   assert(mutex == PTHREAD_RECURSIVE_MUTEX_INITIALIZER);
 
--- tests/mutex7e.c	2006-12-21 01:55:30 -0600
+++ tests/mutex7e.c	2008-09-29 19:09:44 -0500
@@ -74,7 +74,7 @@ int
 main()
 {
   pthread_t t;
-  int result = 0;
+  DWORD_PTR result = 0;
   int mxType = -1;
 
   assert(pthread_mutexattr_init(&mxAttr) == 0);
--- tests/mutex7r.c	2006-12-21 01:55:30 -0600
+++ tests/mutex7r.c	2008-09-29 19:10:18 -0500
@@ -73,7 +73,7 @@ int
 main()
 {
   pthread_t t;
-  int result = 0;
+  DWORD_PTR result = 0;
   int mxType = -1;
 
   assert(pthread_mutexattr_init(&mxAttr) == 0);
--- tests/mutex8.c	2006-12-21 01:55:30 -0600
+++ tests/mutex8.c	2008-09-29 19:11:12 -0500
@@ -49,7 +49,7 @@ void * locker(void * arg)
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 1;
--- tests/mutex8e.c	2006-12-21 01:55:30 -0600
+++ tests/mutex8e.c	2008-09-29 19:11:46 -0500
@@ -57,7 +57,7 @@ void * locker(void * arg)
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 1;
--- tests/mutex8n.c	2006-12-21 01:55:30 -0600
+++ tests/mutex8n.c	2008-09-29 19:12:24 -0500
@@ -57,7 +57,7 @@ void * locker(void * arg)
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 1;
--- tests/mutex8r.c	2006-12-21 01:55:30 -0600
+++ tests/mutex8r.c	2008-09-29 19:12:56 -0500
@@ -57,7 +57,7 @@ void * locker(void * arg)
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 1;
--- tests/rwlock2_t.c	2006-12-21 01:55:30 -0600
+++ tests/rwlock2_t.c	2008-09-29 19:13:50 -0500
@@ -55,7 +55,7 @@ main()
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 1;
--- tests/rwlock3_t.c	2006-12-21 01:55:30 -0600
+++ tests/rwlock3_t.c	2008-09-29 19:14:20 -0500
@@ -68,7 +68,7 @@ main()
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 1;
--- tests/rwlock4_t.c	2006-12-21 01:55:30 -0600
+++ tests/rwlock4_t.c	2008-09-29 19:15:10 -0500
@@ -68,7 +68,7 @@ main()
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 1;
--- tests/rwlock5_t.c	2006-12-21 01:55:30 -0600
+++ tests/rwlock5_t.c	2008-09-29 19:15:40 -0500
@@ -70,7 +70,7 @@ main()
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 1;
--- tests/rwlock6.c	2006-12-21 01:55:30 -0600
+++ tests/rwlock6.c	2008-09-29 19:17:06 -0500
@@ -77,9 +77,9 @@ main()
   pthread_t wrt1;
   pthread_t wrt2;
   pthread_t rdt;
-  int wr1Result = 0;
-  int wr2Result = 0;
-  int rdResult = 0;
+  DWORD_PTR wr1Result = 0;
+  DWORD_PTR wr2Result = 0;
+  DWORD_PTR rdResult = 0;
 
   bankAccount = 0;
 
--- tests/rwlock6_t.c	2006-12-21 01:55:30 -0600
+++ tests/rwlock6_t.c	2008-09-29 19:18:50 -0500
@@ -67,7 +67,7 @@ void * rdfunc(void * arg)
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
 
@@ -95,10 +95,10 @@ main()
   pthread_t wrt2;
   pthread_t rdt1;
   pthread_t rdt2;
-  int wr1Result = 0;
-  int wr2Result = 0;
-  int rd1Result = 0;
-  int rd2Result = 0;
+  DWORD_PTR wr1Result = 0;
+  DWORD_PTR wr2Result = 0;
+  DWORD_PTR rd1Result = 0;
+  DWORD_PTR rd2Result = 0;
 
   bankAccount = 0;
 
--- tests/rwlock6_t2.c	2006-12-21 01:55:30 -0600
+++ tests/rwlock6_t2.c	2008-09-29 19:20:14 -0500
@@ -86,15 +86,15 @@ main()
   pthread_t wrt1;
   pthread_t wrt2;
   pthread_t rdt;
-  int wr1Result = 0;
-  int wr2Result = 0;
-  int rdResult = 0;
+  DWORD_PTR wr1Result = 0;
+  DWORD_PTR wr2Result = 0;
+  DWORD_PTR rdResult = 0;
   struct _timeb currSysTime;
   const DWORD NANOSEC_PER_MILLISEC = 1000000;
 
   _ftime(&currSysTime);
 
-  abstime.tv_sec = currSysTime.time;
+  abstime.tv_sec = (long)currSysTime.time;
   abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
 
   abstime.tv_sec += 1;
--- tests/semaphore1.c	2006-12-21 01:55:30 -0600
+++ tests/semaphore1.c	2008-09-29 19:22:00 -0500
@@ -119,7 +119,7 @@ main()
 {
   pthread_t t;
   sem_t s;
-  int result;
+  DWORD_PTR result;
 
   assert(pthread_create(&t, NULL, thr, NULL) == 0);
   assert(pthread_join(t, (void **)&result) == 0);
--- tests/semaphore4.c	2006-12-21 01:55:30 -0600
+++ tests/semaphore4.c	2008-09-29 19:23:06 -0500
@@ -113,7 +113,7 @@ main()
 //printf("value = %d\n", -value); fflush(stdout);
 	assert(pthread_cancel(t[50]) == 0);
 	  {
-	    int result;
+	    DWORD_PTR result;
 	    assert(pthread_join(t[50], (void **) &result) == 0);
 //	    printf("result = %d\n", result); fflush(stdout);
 	  }
--- tests/spin4.c	2006-12-21 01:55:30 -0600
+++ tests/spin4.c	2008-09-29 19:25:02 -0500
@@ -63,7 +63,7 @@ void * func(void * arg)
 int
 main()
 {
-  long result = 0;
+  DWORD_PTR result = 0;
   pthread_t t;
   int CPUs;
   struct _timeb sysTime;
--- tests/tsd1.c	2006-12-21 01:55:30 -0600
+++ tests/tsd1.c	2008-09-29 19:25:40 -0500
@@ -179,7 +179,7 @@ main()
    */
   for (i = 1; i < NUM_THREADS; i++)
     {
-	int result = 0;
+	DWORD_PTR result = 0;
 
 	assert(pthread_join(thread[i], (void **) &result) == 0);
     }
--- tests/tsd2.c	2006-12-21 01:55:30 -0600
+++ tests/tsd2.c	2008-09-29 19:26:12 -0500
@@ -183,7 +183,7 @@ main()
    */
   for (i = 1; i < NUM_THREADS; i++)
     {
-	int result = 0;
+	DWORD_PTR result = 0;
 
 	assert(pthread_join(thread[i], (void **) &result) == 0);
     }
--- ptw32_timespec.c	2009-11-11 15:28:55.000000000 +0100
+++ ptw32_timespec.c	2009-11-11 15:29:02.000000000 +0100
@@ -47,6 +47,13 @@
 #define PTW32_TIMESPEC_TO_FILETIME_OFFSET \
 	  ( ((LONGLONG) 27111902 << 32) + (LONGLONG) 3577643008 )
 
+#ifndef __MINGW64_VERSION_MAJOR
+struct timespec {
+        long tv_sec;
+        long tv_nsec;
+};
+#endif /* __MINGW64_VERSION_MAJOR */
+
 INLINE void
 ptw32_timespec_to_filetime (const struct timespec *ts, FILETIME * ft)
      /*
--- ptw32_relmillisecs.c	2009-11-11 15:23:35.000000000 +0100
+++ ptw32_relmillisecs.c	2009-11-11 15:28:05.000000000 +0100
@@ -43,6 +43,12 @@
 #include <sys/timeb.h>
 #endif
 
+#ifndef __MINGW64_VERSION_MAJOR
+struct timespec {
+        long tv_sec;
+        long tv_nsec;
+};
+#endif /* __MINGW64_VERSION_MAJOR */
 
 INLINE DWORD
 ptw32_relmillisecs (const struct timespec * abstime)