]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/win32/patches/pthreads-w64.patch
Restore win32 dir from Branch-5.2 and update it
[bacula/bacula] / bacula / src / win32 / patches / pthreads-w64.patch
1 diff -Naur ../pthreads-snap-2004-06-22/GNUmakefile ./GNUmakefile
2 --- ../pthreads-snap-2004-06-22/GNUmakefile     2004-05-20 02:56:52.000000000 +0200
3 +++ ./GNUmakefile       2009-01-07 15:57:36.000000000 +0100
4 @@ -48,9 +48,9 @@
5  
6  #OPT   = -g
7  #OPT   = -O3 -DTEST_ICE
8 -OPT    = -O3 -finline-functions
9 +OPT    = $(CLEANUP) -O3  -DHAVE_STRUCT_TIMESPEC -D__MINGW32__ -finline-functions
10  
11 -LFLAGS         = -lwsock32
12 +LFLAGS         = -lws2_32
13  
14  GC_CFLAGS      = -D__CLEANUP_C
15  GCE_CFLAGS     = -D__CLEANUP_CXX -mthreads
16 @@ -408,16 +408,16 @@
17         @ $(MAKE) clean GC
18  
19  GC:
20 -               $(MAKE) CC=gcc CLEANUP_FLAGS="$(GC_CFLAGS)" OBJ="$(DLL_OBJS)" $(GC_DLL)
21 +               $(MAKE) CC=mingw32-gcc CLEANUP_FLAGS="$(GC_CFLAGS)" OBJ="$(DLL_OBJS)" $(GC_DLL)
22  
23  GCE:
24 -               $(MAKE) CC=g++ CLEANUP_FLAGS="$(GCE_CFLAGS)" OBJ="$(DLL_OBJS)" $(GCE_DLL)
25 +               $(MAKE) CC=mingw32-g++ CLEANUP_FLAGS="$(GCE_CFLAGS)" OBJ="$(DLL_OBJS)" $(GCE_DLL)
26  
27  GC-inlined:
28 -               $(MAKE) CC=gcc CLEANUP_FLAGS="$(GC_CFLAGS)" OBJ="$(DLL_INLINED_OBJS)" $(GC_INLINED_STAMP)
29 +               $(MAKE) CC=mingw32-gcc CLEANUP_FLAGS="$(GC_CFLAGS)" OBJ="$(DLL_INLINED_OBJS)" $(GC_INLINED_STAMP)
30  
31  GCE-inlined:
32 -               $(MAKE) CC=g++ CLEANUP_FLAGS="$(GCE_CFLAGS)" OBJ="$(DLL_INLINED_OBJS)" $(GCE_INLINED_STAMP)
33 +               $(MAKE) CC=mingw32-g++ CLEANUP_FLAGS="$(GCE_CFLAGS)" OBJ="$(DLL_INLINED_OBJS)" $(GCE_INLINED_STAMP)
34  
35  tests:
36         @ cd tests
37 @@ -436,24 +436,24 @@
38  
39  $(GC_DLL): $(DLL_OBJS)
40         $(CC) $(OPT) -shared -o $(GC_DLL) $(DLL_OBJS) $(LFLAGS)
41 -       dlltool -z pthread.def $(DLL_OBJS)
42 -       dlltool -k --dllname $@ --output-lib $(GC_LIB) --def $(PTHREAD_DEF)
43 +       mingw32-dlltool -z pthread.def $(DLL_OBJS)
44 +       mingw32-dlltool -k --dllname $@ --output-lib $(GC_LIB) --def $(PTHREAD_DEF)
45  
46  $(GCE_DLL): $(DLL_OBJS)
47         $(CC) $(OPT) -mthreads -shared -o $(GCE_DLL) $(DLL_OBJS) $(LFLAGS)
48 -       dlltool -z pthread.def $(DLL_OBJS)
49 -       dlltool -k --dllname $@ --output-lib $(GCE_LIB) --def $(PTHREAD_DEF)
50 +       mingw32-dlltool -z pthread.def $(DLL_OBJS)
51 +       mingw32-dlltool -k --dllname $@ --output-lib $(GCE_LIB) --def $(PTHREAD_DEF)
52  
53  $(GC_INLINED_STAMP): $(DLL_INLINED_OBJS)
54         $(CC) $(OPT) -shared -o $(GC_DLL) $(DLL_INLINED_OBJS) $(LFLAGS)
55 -       dlltool -z pthread.def $(DLL_INLINED_OBJS)
56 -       dlltool -k --dllname $(GC_DLL) --output-lib $(GC_LIB) --def $(PTHREAD_DEF)
57 +       mingw32-dlltool -z pthread.def $(DLL_INLINED_OBJS)
58 +       mingw32-dlltool -k --dllname $(GC_DLL) --output-lib $(GC_LIB) --def $(PTHREAD_DEF)
59         echo touched > $(GC_INLINED_STAMP)
60  
61  $(GCE_INLINED_STAMP): $(DLL_INLINED_OBJS)
62         $(CC) $(OPT) -mthreads -shared -o $(GCE_DLL) $(DLL_INLINED_OBJS)  $(LFLAGS)
63 -       dlltool -z pthread.def $(DLL_INLINED_OBJS)
64 -       dlltool -k --dllname $(GCE_DLL) --output-lib $(GCE_LIB) --def $(PTHREAD_DEF)
65 +       mingw32-dlltool -z pthread.def $(DLL_INLINED_OBJS)
66 +       mingw32-dlltool -k --dllname $(GCE_DLL) --output-lib $(GCE_LIB) --def $(PTHREAD_DEF)
67         echo touched > $(GCE_INLINED_STAMP)
68  
69  clean:
70 diff -Naur ../pthreads-snap-2004-06-22/implement.h ./implement.h
71 --- ../pthreads-snap-2004-06-22/implement.h     2004-06-22 08:12:54.000000000 +0200
72 +++ ./implement.h       2009-01-07 15:57:36.000000000 +0100
73 @@ -38,7 +38,9 @@
74  #ifndef _IMPLEMENT_H
75  #define _IMPLEMENT_H
76  
77 +#ifndef _WIN32_WINNT
78  #define _WIN32_WINNT 0x400
79 +#endif
80  
81  #include <windows.h>
82  
83 diff -Naur ../pthreads-snap-2004-06-22/pthread_cancel.c ./pthread_cancel.c
84 --- ../pthreads-snap-2004-06-22/pthread_cancel.c        2004-05-17 03:38:02.000000000 +0200
85 +++ ./pthread_cancel.c  2009-01-07 15:57:36.000000000 +0100
86 @@ -70,7 +70,7 @@
87  }
88  
89  static void CALLBACK
90 -ptw32_cancel_callback (DWORD unused)
91 +ptw32_cancel_callback (ULONG_PTR unused)
92  {
93    ptw32_throw (PTW32_EPS_CANCEL);
94  
95 diff -Naur ../pthreads-snap-2004-06-22/pthread_exit.c ./pthread_exit.c
96 --- ../pthreads-snap-2004-06-22/pthread_exit.c  2004-05-17 03:38:03.000000000 +0200
97 +++ ./pthread_exit.c    2009-01-07 15:57:36.000000000 +0100
98 @@ -89,7 +89,7 @@
99         */
100  
101  #if ! defined (__MINGW32__) || defined (__MSVCRT__)
102 -      _endthreadex ((unsigned) value_ptr);
103 +      _endthreadex ((unsigned) ((ULONG_PTR)value_ptr));
104  #else
105        _endthread ();
106  #endif
107 diff -Naur ../pthreads-snap-2004-06-22/pthread_getspecific.c ./pthread_getspecific.c
108 --- ../pthreads-snap-2004-06-22/pthread_getspecific.c   2004-05-17 03:38:03.000000000 +0200
109 +++ ./pthread_getspecific.c     2009-01-07 15:57:36.000000000 +0100
110 @@ -63,13 +63,18 @@
111        * ------------------------------------------------------
112        */
113  {
114 -  int lasterror = GetLastError ();
115 -  int lastWSAerror = WSAGetLastError ();
116 +  void *ptr;
117  
118 -  void *ptr = TlsGetValue (key->key);
119 +  if (key == NULL) {
120 +     ptr = NULL;
121 +  } else {
122 +     int lasterror = GetLastError ();
123 +     int lastWSAerror = WSAGetLastError ();
124  
125 -  SetLastError (lasterror);
126 -  WSASetLastError (lastWSAerror);
127 +     ptr = TlsGetValue(key->key);
128  
129 +     SetLastError(lasterror);
130 +     WSASetLastError(lastWSAerror);
131 +  }
132    return ptr;
133  }
134 diff -Naur ../pthreads-snap-2004-06-22/pthread.h ./pthread.h
135 --- ../pthreads-snap-2004-06-22/pthread.h       2004-06-22 08:12:54.000000000 +0200
136 +++ ./pthread.h 2009-01-07 15:57:36.000000000 +0100
137 @@ -274,10 +274,6 @@
138  #endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */
139  
140  #ifndef HAVE_STRUCT_TIMESPEC
141 -struct timespec {
142 -        long tv_sec;
143 -        long tv_nsec;
144 -};
145  #endif /* HAVE_STRUCT_TIMESPEC */
146  
147  #ifndef SIG_BLOCK
148 diff -Naur ../pthreads-snap-2004-06-22/ptw32_InterlockedCompareExchange.c ./ptw32_InterlockedCompareExchange.c
149 --- ../pthreads-snap-2004-06-22/ptw32_InterlockedCompareExchange.c      2004-05-17 03:38:03.000000000 +0200
150 +++ ./ptw32_InterlockedCompareExchange.c        2009-01-07 15:57:36.000000000 +0100
151 @@ -101,6 +101,19 @@
152  #endif
153  
154  #else
155 +#if defined(_WIN64)
156 +   /*
157 +    * Microsoft Visual C++ 7.1 and newer have _Interlocked intrinsics
158 +    */
159 +       {
160 +               result = InterlockedCompareExchange(LONG volatile *Destination,LONG ExChange,LONG Comperand);
161 +       }
162 +       else
163 +       {
164 +               result = InterlockedCompareExchange(LONG volatile *Destination,LONG ExChange,LONG Comperand);
165 +       }
166 + #else
167 +
168  
169    /*
170     * If execution gets to here then we should be running on a Win95 system
171 @@ -110,7 +123,8 @@
172     */
173  
174    result = 0;
175 -
176 +#error Unsupported platform or compiler!
177 +#endif
178  #endif
179  
180  /* *INDENT-ON* */
181 diff -Naur ../pthreads-snap-2004-06-22/ptw32_semwait.c ./ptw32_semwait.c
182 --- ../pthreads-snap-2004-06-22/ptw32_semwait.c 2004-05-17 09:59:47.000000000 +0200
183 +++ ./ptw32_semwait.c   2009-01-07 15:57:36.000000000 +0100
184 @@ -41,7 +41,7 @@
185  #include "implement.h"
186  
187  
188 -INLINE int
189 +int
190  ptw32_semwait (sem_t * sem)
191       /*
192        * ------------------------------------------------------
193 diff -Naur ../pthreads-snap-2004-06-22/ptw32_threadStart.c ./ptw32_threadStart.c
194 --- ../pthreads-snap-2004-06-22/ptw32_threadStart.c     2004-05-17 03:38:03.000000000 +0200
195 +++ ./ptw32_threadStart.c       2009-01-07 15:57:36.000000000 +0100
196 @@ -356,7 +356,7 @@
197      }
198  
199  #if ! defined (__MINGW32__) || defined (__MSVCRT__)
200 -  _endthreadex ((unsigned) status);
201 +  _endthreadex ((unsigned) ((ULONG_PTR)status));
202  #else
203    _endthread ();
204  #endif
205 @@ -366,7 +366,7 @@
206     */
207  
208  #if ! defined (__MINGW32__) || defined (__MSVCRT__)
209 -  return (unsigned) status;
210 +  return (unsigned) ((ULONG_PTR)status);
211  #endif
212  
213  }                              /* ptw32_threadStart */
214 diff -Naur ../pthreads-snap-2004-06-22/ptw32_throw.c ./ptw32_throw.c
215 --- ../pthreads-snap-2004-06-22/ptw32_throw.c   2004-05-17 03:38:03.000000000 +0200
216 +++ ./ptw32_throw.c     2009-01-07 15:57:36.000000000 +0100
217 @@ -78,10 +78,10 @@
218        switch (exception)
219         {
220         case PTW32_EPS_CANCEL:
221 -         exitCode = (unsigned) PTHREAD_CANCELED;
222 +         exitCode = (unsigned) ((ULONG_PTR)PTHREAD_CANCELED);
223           break;
224         case PTW32_EPS_EXIT:
225 -         exitCode = (unsigned) self->exitStatus;;
226 +         exitCode = (unsigned) ((ULONG_PTR)self->exitStatus);;
227           break;
228         }
229  
230 diff -Naur ../pthreads-snap-2004-06-22/tests/barrier3.c ./tests/barrier3.c
231 --- ../pthreads-snap-2004-06-22/tests/barrier3.c        2003-08-19 05:31:51.000000000 +0200
232 +++ ./tests/barrier3.c  2009-01-07 15:57:36.000000000 +0100
233 @@ -41,7 +41,7 @@
234  #include "test.h"
235   
236  pthread_barrier_t barrier = NULL;
237 -static int result = 1;
238 +static DWORD_PTR result = 1;
239  
240  void * func(void * arg)
241  {
242 diff -Naur ../pthreads-snap-2004-06-22/tests/barrier5.c ./tests/barrier5.c
243 --- ../pthreads-snap-2004-06-22/tests/barrier5.c        2003-08-19 05:31:51.000000000 +0200
244 +++ ./tests/barrier5.c  2009-01-07 15:57:36.000000000 +0100
245 @@ -90,7 +90,7 @@
246  main()
247  {
248    int i, j;
249 -  int result;
250 +  DWORD_PTR result;
251    int serialThreadsTotal;
252    pthread_t t[NUMTHREADS + 1];
253  
254 @@ -112,7 +112,7 @@
255        for (i = 1; i <= j; i++)
256          {
257            assert(pthread_join(t[i], (void **) &result) == 0);
258 -          serialThreadsTotal += result;
259 +           serialThreadsTotal += (int)result;
260          }
261  
262        assert(serialThreadsTotal == BARRIERS - 1);
263 diff -Naur ../pthreads-snap-2004-06-22/tests/cancel2.c ./tests/cancel2.c
264 --- ../pthreads-snap-2004-06-22/tests/cancel2.c 2003-08-19 05:31:51.000000000 +0200
265 +++ ./tests/cancel2.c   2009-01-07 15:57:36.000000000 +0100
266 @@ -217,7 +217,7 @@
267    for (i = 1; i <= NUMTHREADS; i++)
268      {
269        int fail = 0;
270 -      int result = 0;
271 +      DWORD_PTR result = 0;
272  
273        assert(pthread_join(t[i], (void **) &result) == 0);
274        fail = (result != (int) PTHREAD_CANCELED);
275 diff -Naur ../pthreads-snap-2004-06-22/tests/cancel3.c ./tests/cancel3.c
276 --- ../pthreads-snap-2004-06-22/tests/cancel3.c 2004-05-17 03:38:03.000000000 +0200
277 +++ ./tests/cancel3.c   2009-01-07 15:57:36.000000000 +0100
278 @@ -173,7 +173,7 @@
279    for (i = 1; i <= NUMTHREADS; i++)
280      {
281        int fail = 0;
282 -      int result = 0;
283 +      DWORD_PTR result = 0;
284  
285        /*
286         * The thread does not contain any cancelation points, so
287 diff -Naur ../pthreads-snap-2004-06-22/tests/cancel4.c ./tests/cancel4.c
288 --- ../pthreads-snap-2004-06-22/tests/cancel4.c 2004-05-17 03:38:03.000000000 +0200
289 +++ ./tests/cancel4.c   2009-01-07 15:57:36.000000000 +0100
290 @@ -173,7 +173,7 @@
291    for (i = 1; i <= NUMTHREADS; i++)
292      {
293        int fail = 0;
294 -      int result = 0;
295 +      DWORD_PTR result = 0;
296  
297        /*
298         * The thread does not contain any cancelation points, so
299 diff -Naur ../pthreads-snap-2004-06-22/tests/cancel5.c ./tests/cancel5.c
300 --- ../pthreads-snap-2004-06-22/tests/cancel5.c 2004-05-17 03:38:03.000000000 +0200
301 +++ ./tests/cancel5.c   2009-01-07 15:57:36.000000000 +0100
302 @@ -171,7 +171,7 @@
303    for (i = 1; i <= NUMTHREADS; i++)
304      {
305        int fail = 0;
306 -      int result = 0;
307 +      DWORD_PTR result = 0;
308  
309        /*
310         * The thread does not contain any cancelation points, so
311 diff -Naur ../pthreads-snap-2004-06-22/tests/cancel6a.c ./tests/cancel6a.c
312 --- ../pthreads-snap-2004-06-22/tests/cancel6a.c        2004-05-17 03:38:03.000000000 +0200
313 +++ ./tests/cancel6a.c  2009-01-07 15:57:36.000000000 +0100
314 @@ -161,7 +161,7 @@
315    for (i = 1; i <= NUMTHREADS; i++)
316      {
317        int fail = 0;
318 -      int result = 0;
319 +      DWORD_PTR result = 0;
320  
321        /*
322         * The thread does not contain any cancelation points, so
323 diff -Naur ../pthreads-snap-2004-06-22/tests/cancel6d.c ./tests/cancel6d.c
324 --- ../pthreads-snap-2004-06-22/tests/cancel6d.c        2004-05-17 03:38:03.000000000 +0200
325 +++ ./tests/cancel6d.c  2009-01-07 15:57:36.000000000 +0100
326 @@ -165,7 +165,7 @@
327    for (i = 1; i <= NUMTHREADS; i++)
328      {
329        int fail = 0;
330 -      int result = 0;
331 +      DWORD_PTR result = 0;
332  
333        /*
334         * The thread does not contain any cancelation points, so
335 diff -Naur ../pthreads-snap-2004-06-22/tests/cleanup0.c ./tests/cleanup0.c
336 --- ../pthreads-snap-2004-06-22/tests/cleanup0.c        2003-08-19 05:31:51.000000000 +0200
337 +++ ./tests/cleanup0.c  2009-01-07 15:57:36.000000000 +0100
338 @@ -180,7 +180,7 @@
339    for (i = 1; i <= NUMTHREADS; i++)
340      {
341        int fail = 0;
342 -      int result = 0;
343 +      DWORD_PTR result = 0;
344  
345        assert(pthread_join(t[i], (void **) &result) == 0);
346  
347 diff -Naur ../pthreads-snap-2004-06-22/tests/cleanup1.c ./tests/cleanup1.c
348 --- ../pthreads-snap-2004-06-22/tests/cleanup1.c        2003-08-19 05:31:51.000000000 +0200
349 +++ ./tests/cleanup1.c  2009-01-07 15:57:36.000000000 +0100
350 @@ -195,7 +195,7 @@
351    for (i = 1; i <= NUMTHREADS; i++)
352      {
353        int fail = 0;
354 -      int result = 0;
355 +      DWORD_PTR result = 0;
356  
357        assert(pthread_join(t[i], (void **) &result) == 0);
358  
359 diff -Naur ../pthreads-snap-2004-06-22/tests/cleanup2.c ./tests/cleanup2.c
360 --- ../pthreads-snap-2004-06-22/tests/cleanup2.c        2003-08-19 05:31:51.000000000 +0200
361 +++ ./tests/cleanup2.c  2009-01-07 15:57:36.000000000 +0100
362 @@ -169,7 +169,7 @@
363    for (i = 1; i <= NUMTHREADS; i++)
364      {
365        int fail = 0;
366 -      int result = 0;
367 +      DWORD_PTR result = 0;
368  
369        assert(pthread_join(t[i], (void **) &result) == 0);
370  
371 diff -Naur ../pthreads-snap-2004-06-22/tests/cleanup3.c ./tests/cleanup3.c
372 --- ../pthreads-snap-2004-06-22/tests/cleanup3.c        2003-08-19 05:31:51.000000000 +0200
373 +++ ./tests/cleanup3.c  2009-01-07 15:57:36.000000000 +0100
374 @@ -172,7 +172,7 @@
375    for (i = 1; i <= NUMTHREADS; i++)
376      {
377        int fail = 0;
378 -      int result = 0;
379 +      DWORD_PTR result = 0;
380  
381        assert(pthread_join(t[i], (void **) &result) == 0);
382  
383 diff -Naur ../pthreads-snap-2004-06-22/tests/condvar1_2.c ./tests/condvar1_2.c
384 --- ../pthreads-snap-2004-06-22/tests/condvar1_2.c      2003-08-19 05:31:51.000000000 +0200
385 +++ ./tests/condvar1_2.c        2009-01-07 15:57:36.000000000 +0100
386 @@ -89,7 +89,7 @@
387  main()
388  {
389    int i, j, k;
390 -  int result = -1;
391 +  DWORD_PTR result = -1;
392    pthread_t t;
393  
394    for (k = 0; k < NUM_LOOPS; k++)
395 diff -Naur ../pthreads-snap-2004-06-22/tests/condvar2_1.c ./tests/condvar2_1.c
396 --- ../pthreads-snap-2004-06-22/tests/condvar2_1.c      2004-05-20 02:56:52.000000000 +0200
397 +++ ./tests/condvar2_1.c        2009-01-07 15:57:36.000000000 +0100
398 @@ -105,7 +105,7 @@
399  {
400    int i;
401    pthread_t t[NUMTHREADS + 1];
402 -  int result = 0;
403 +  DWORD_PTR result = 0;
404    struct _timeb currSysTime;
405    const DWORD NANOSEC_PER_MILLISEC = 1000000;
406  
407 @@ -116,7 +116,7 @@
408    /* get current system time */
409    _ftime(&currSysTime);
410  
411 -  abstime.tv_sec = currSysTime.time;
412 +  abstime.tv_sec = (long)currSysTime.time;
413    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
414  
415    abstime.tv_sec += 5;
416 diff -Naur ../pthreads-snap-2004-06-22/tests/condvar2.c ./tests/condvar2.c
417 --- ../pthreads-snap-2004-06-22/tests/condvar2.c        2004-05-20 02:56:52.000000000 +0200
418 +++ ./tests/condvar2.c  2009-01-07 15:57:36.000000000 +0100
419 @@ -99,7 +99,7 @@
420    /* get current system time */
421    _ftime(&currSysTime);
422  
423 -  abstime.tv_sec = currSysTime.time;
424 +  abstime.tv_sec = (long)currSysTime.time;
425    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
426  
427    abstime.tv_sec += 5;
428 @@ -109,7 +109,7 @@
429    assert(pthread_mutex_unlock(&mutex) == 0);
430  
431    {
432 -  int result = pthread_cond_destroy(&cv);
433 +  DWORD_PTR result = pthread_cond_destroy(&cv);
434    if (result != 0)
435      {
436        fprintf(stderr, "Result = %s\n", error_string[result]);
437 diff -Naur ../pthreads-snap-2004-06-22/tests/condvar3_1.c ./tests/condvar3_1.c
438 --- ../pthreads-snap-2004-06-22/tests/condvar3_1.c      2004-05-20 02:56:52.000000000 +0200
439 +++ ./tests/condvar3_1.c        2009-01-07 15:57:36.000000000 +0100
440 @@ -125,7 +125,7 @@
441  {
442    int i;
443    pthread_t t[NUMTHREADS + 1];
444 -  int result = 0;
445 +  DWORD_PTR result = 0;
446    struct _timeb currSysTime;
447    const DWORD NANOSEC_PER_MILLISEC = 1000000;
448  
449 @@ -137,7 +137,7 @@
450    /* get current system time */
451    _ftime(&currSysTime);
452  
453 -  abstime.tv_sec = currSysTime.time;
454 +  abstime.tv_sec = (long)currSysTime.time;
455    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
456  
457    abstime.tv_sec += 5;
458 diff -Naur ../pthreads-snap-2004-06-22/tests/condvar3_2.c ./tests/condvar3_2.c
459 --- ../pthreads-snap-2004-06-22/tests/condvar3_2.c      2004-05-20 02:56:52.000000000 +0200
460 +++ ./tests/condvar3_2.c        2009-01-07 15:57:36.000000000 +0100
461 @@ -127,7 +127,7 @@
462  {
463    int i;
464    pthread_t t[NUMTHREADS + 1];
465 -  int result = 0;
466 +  DWORD_PTR result = 0;
467    struct _timeb currSysTime;
468    const DWORD NANOSEC_PER_MILLISEC = 1000000;
469  
470 @@ -138,7 +138,7 @@
471    /* get current system time */
472    _ftime(&currSysTime);
473  
474 -  abstime.tv_sec = abstime.tv_sec = currSysTime.time + 5;
475 +  abstime.tv_sec = abstime.tv_sec = (long)currSysTime.time + 5;
476    abstime.tv_nsec = abstime2.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
477  
478    assert(pthread_mutex_lock(&mutex) == 0);
479 diff -Naur ../pthreads-snap-2004-06-22/tests/condvar3_3.c ./tests/condvar3_3.c
480 --- ../pthreads-snap-2004-06-22/tests/condvar3_3.c      2003-08-19 05:31:51.000000000 +0200
481 +++ ./tests/condvar3_3.c        2009-01-07 15:57:36.000000000 +0100
482 @@ -96,7 +96,7 @@
483     /* get current system time */
484     _ftime(&currSysTime);
485  
486 -   abstime.tv_sec = currSysTime.time;
487 +   abstime.tv_sec = (long)currSysTime.time;
488     abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
489     abstime.tv_sec += 1;
490  
491 @@ -120,7 +120,7 @@
492  
493     assert(pthread_mutex_lock(&mtx) == 0);
494  
495 -   abstime.tv_sec = currSysTime.time;
496 +   abstime.tv_sec = (long)currSysTime.time;
497     abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
498     abstime.tv_sec += 1;
499  
500 diff -Naur ../pthreads-snap-2004-06-22/tests/condvar3.c ./tests/condvar3.c
501 --- ../pthreads-snap-2004-06-22/tests/condvar3.c        2003-08-19 05:31:51.000000000 +0200
502 +++ ./tests/condvar3.c  2009-01-07 15:57:36.000000000 +0100
503 @@ -127,7 +127,7 @@
504    /* get current system time */
505    _ftime(&currSysTime);
506  
507 -  abstime.tv_sec = currSysTime.time;
508 +  abstime.tv_sec = (long)currSysTime.time;
509    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
510  
511    assert(pthread_create(&t[1], NULL, mythread, (void *) 1) == 0);
512 diff -Naur ../pthreads-snap-2004-06-22/tests/condvar4.c ./tests/condvar4.c
513 --- ../pthreads-snap-2004-06-22/tests/condvar4.c        2003-08-19 05:31:51.000000000 +0200
514 +++ ./tests/condvar4.c  2009-01-07 15:57:36.000000000 +0100
515 @@ -132,7 +132,7 @@
516    /* get current system time */
517    _ftime(&currSysTime);
518  
519 -  abstime.tv_sec = currSysTime.time;
520 +  abstime.tv_sec = (long)currSysTime.time;
521    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
522  
523    abstime.tv_sec += 5;
524 @@ -145,7 +145,7 @@
525  
526    _ftime(&currSysTime);
527  
528 -  abstime.tv_sec = currSysTime.time;
529 +  abstime.tv_sec = (long)currSysTime.time;
530    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
531  
532    abstime.tv_sec += 5;
533 diff -Naur ../pthreads-snap-2004-06-22/tests/condvar5.c ./tests/condvar5.c
534 --- ../pthreads-snap-2004-06-22/tests/condvar5.c        2003-08-19 05:31:51.000000000 +0200
535 +++ ./tests/condvar5.c  2009-01-07 15:57:36.000000000 +0100
536 @@ -131,7 +131,7 @@
537    /* get current system time */
538    _ftime(&currSysTime);
539  
540 -  abstime.tv_sec = currSysTime.time;
541 +  abstime.tv_sec = (long)currSysTime.time;
542    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
543  
544    abstime.tv_sec += 5;
545 @@ -144,7 +144,7 @@
546  
547    _ftime(&currSysTime);
548  
549 -  abstime.tv_sec = currSysTime.time;
550 +  abstime.tv_sec = (long)currSysTime.time;
551    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
552  
553    abstime.tv_sec += 5;
554 diff -Naur ../pthreads-snap-2004-06-22/tests/condvar6.c ./tests/condvar6.c
555 --- ../pthreads-snap-2004-06-22/tests/condvar6.c        2003-08-19 05:31:51.000000000 +0200
556 +++ ./tests/condvar6.c  2009-01-07 15:57:36.000000000 +0100
557 @@ -159,7 +159,7 @@
558  
559    _ftime(&currSysTime);
560  
561 -  abstime.tv_sec = currSysTime.time;
562 +  abstime.tv_sec = (long)currSysTime.time;
563    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
564  
565    abstime.tv_sec += 5;
566 diff -Naur ../pthreads-snap-2004-06-22/tests/condvar7.c ./tests/condvar7.c
567 --- ../pthreads-snap-2004-06-22/tests/condvar7.c        2003-08-19 05:31:51.000000000 +0200
568 +++ ./tests/condvar7.c  2009-01-07 15:57:36.000000000 +0100
569 @@ -169,7 +169,7 @@
570  
571    _ftime(&currSysTime);
572  
573 -  abstime.tv_sec = currSysTime.time;
574 +  abstime.tv_sec = (long)currSysTime.time;
575    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
576  
577    abstime.tv_sec += 10;
578 diff -Naur ../pthreads-snap-2004-06-22/tests/condvar8.c ./tests/condvar8.c
579 --- ../pthreads-snap-2004-06-22/tests/condvar8.c        2003-08-19 05:31:51.000000000 +0200
580 +++ ./tests/condvar8.c  2009-01-07 15:57:36.000000000 +0100
581 @@ -166,7 +166,7 @@
582  
583    _ftime(&currSysTime);
584  
585 -  abstime.tv_sec = currSysTime.time;
586 +  abstime.tv_sec = (long)currSysTime.time;
587    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
588  
589    abstime.tv_sec += 10;
590 diff -Naur ../pthreads-snap-2004-06-22/tests/condvar9.c ./tests/condvar9.c
591 --- ../pthreads-snap-2004-06-22/tests/condvar9.c        2003-08-19 05:31:51.000000000 +0200
592 +++ ./tests/condvar9.c  2009-01-07 15:57:36.000000000 +0100
593 @@ -172,7 +172,7 @@
594  
595    _ftime(&currSysTime);
596  
597 -  abstime.tv_sec = currSysTime.time;
598 +  abstime.tv_sec = (long)currSysTime.time;
599    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
600  
601    abstime.tv_sec += 5;
602 diff -Naur ../pthreads-snap-2004-06-22/tests/context1.c ./tests/context1.c
603 --- ../pthreads-snap-2004-06-22/tests/context1.c        2004-05-20 02:56:52.000000000 +0200
604 +++ ./tests/context1.c  2009-01-07 15:57:36.000000000 +0100
605 @@ -125,7 +125,11 @@
606        /*
607         *_x86 only!!!
608         */
609 +#if defined(_M_IX86)
610        context.Eip = (DWORD) anotherEnding;
611 +#else
612 +      context.Rip = (DWORD64) anotherEnding;
613 +#endif
614        SetThreadContext(hThread, &context);
615        ResumeThread(hThread);
616      }
617 diff -Naur ../pthreads-snap-2004-06-22/tests/delay2.c ./tests/delay2.c
618 --- ../pthreads-snap-2004-06-22/tests/delay2.c  2003-08-19 05:31:51.000000000 +0200
619 +++ ./tests/delay2.c    2009-01-07 15:57:36.000000000 +0100
620 @@ -65,7 +65,7 @@
621  main(int argc, char * argv[])
622  {
623    pthread_t t;
624 -  int result = 0;
625 +  DWORD_PTR result = 0;
626  
627    assert(pthread_mutex_lock(&mx) == 0);
628  
629 diff -Naur ../pthreads-snap-2004-06-22/tests/exception1.c ./tests/exception1.c
630 --- ../pthreads-snap-2004-06-22/tests/exception1.c      2003-08-19 05:31:51.000000000 +0200
631 +++ ./tests/exception1.c        2009-01-07 15:57:36.000000000 +0100
632 @@ -226,7 +226,7 @@
633    for (i = 0; i < NUMTHREADS; i++)
634      {
635        int fail = 0;
636 -      int result = 0;
637 +      DWORD_PTR result = 0;
638  
639         /* Canceled thread */
640        assert(pthread_join(ct[i], (void **) &result) == 0);
641 diff -Naur ../pthreads-snap-2004-06-22/tests/GNUmakefile ./tests/GNUmakefile
642 --- ../pthreads-snap-2004-06-22/tests/GNUmakefile       2004-06-22 08:12:55.000000000 +0200
643 +++ ./tests/GNUmakefile 2009-01-07 15:57:36.000000000 +0100
644 @@ -64,7 +64,7 @@
645  DLL    = pthread$(GCX).dll
646  QAPC   = ../QueueUserAPCEx/User/quserex.dll
647  
648 -COPYFILES      = $(HDR) $(LIB) $(DLL) $(QAPC)
649 +COPYFILES      = $(HDR) $(LIB) $(DLL)
650  
651  # If a test case returns a non-zero exit code to the shell, make will
652  # stop.
653 diff -Naur ../pthreads-snap-2004-06-22/tests/join0.c ./tests/join0.c
654 --- ../pthreads-snap-2004-06-22/tests/join0.c   2003-08-19 05:31:51.000000000 +0200
655 +++ ./tests/join0.c     2009-01-07 15:57:36.000000000 +0100
656 @@ -53,7 +53,7 @@
657  main(int argc, char * argv[])
658  {
659    pthread_t id;
660 -  int result;
661 +  DWORD_PTR result;
662  
663    /* Create a single thread and wait for it to exit. */
664    assert(pthread_create(&id, NULL, func, (void *) 123) == 0);
665 diff -Naur ../pthreads-snap-2004-06-22/tests/join1.c ./tests/join1.c
666 --- ../pthreads-snap-2004-06-22/tests/join1.c   2003-08-19 05:31:51.000000000 +0200
667 +++ ./tests/join1.c     2009-01-07 15:57:36.000000000 +0100
668 @@ -56,7 +56,7 @@
669  {
670         pthread_t id[4];
671         int i;
672 -       int result;
673 +       DWORD_PTR result;
674  
675         /* Create a few threads and then exit. */
676         for (i = 0; i < 4; i++)
677 diff -Naur ../pthreads-snap-2004-06-22/tests/join2.c ./tests/join2.c
678 --- ../pthreads-snap-2004-06-22/tests/join2.c   2003-08-19 05:31:51.000000000 +0200
679 +++ ./tests/join2.c     2009-01-07 15:57:36.000000000 +0100
680 @@ -50,7 +50,7 @@
681  {
682         pthread_t id[4];
683         int i;
684 -       int result;
685 +       DWORD_PTR result;
686  
687         /* Create a few threads and then exit. */
688         for (i = 0; i < 4; i++)
689 diff -Naur ../pthreads-snap-2004-06-22/tests/join3.c ./tests/join3.c
690 --- ../pthreads-snap-2004-06-22/tests/join3.c   2004-05-22 03:17:58.000000000 +0200
691 +++ ./tests/join3.c     2009-01-07 15:57:36.000000000 +0100
692 @@ -50,7 +50,7 @@
693  {
694         pthread_t id[4];
695         int i;
696 -       int result;
697 +       DWORD_PTR result;
698  
699         /* Create a few threads and then exit. */
700         for (i = 0; i < 4; i++)
701 diff -Naur ../pthreads-snap-2004-06-22/tests/mutex6e.c ./tests/mutex6e.c
702 --- ../pthreads-snap-2004-06-22/tests/mutex6e.c 2003-08-19 05:31:51.000000000 +0200
703 +++ ./tests/mutex6e.c   2009-01-07 15:57:36.000000000 +0100
704 @@ -74,7 +74,7 @@
705  main()
706  {
707    pthread_t t;
708 -  int result = 0;
709 +  DWORD_PTR result = 0;
710    int mxType = -1;
711  
712    assert(pthread_mutexattr_init(&mxAttr) == 0);
713 diff -Naur ../pthreads-snap-2004-06-22/tests/mutex6es.c ./tests/mutex6es.c
714 --- ../pthreads-snap-2004-06-22/tests/mutex6es.c        2004-06-22 08:12:55.000000000 +0200
715 +++ ./tests/mutex6es.c  2009-01-07 15:57:36.000000000 +0100
716 @@ -73,7 +73,7 @@
717  main()
718  {
719    pthread_t t;
720 -  int result = 0;
721 +  DWORD_PTR result = 0;
722  
723    assert(mutex == PTHREAD_ERRORCHECK_MUTEX_INITIALIZER);
724  
725 diff -Naur ../pthreads-snap-2004-06-22/tests/mutex6r.c ./tests/mutex6r.c
726 --- ../pthreads-snap-2004-06-22/tests/mutex6r.c 2003-08-19 05:31:51.000000000 +0200
727 +++ ./tests/mutex6r.c   2009-01-07 15:57:36.000000000 +0100
728 @@ -73,7 +73,7 @@
729  main()
730  {
731    pthread_t t;
732 -  int result = 0;
733 +  DWORD_PTR result = 0;
734    int mxType = -1;
735  
736    assert(pthread_mutexattr_init(&mxAttr) == 0);
737 diff -Naur ../pthreads-snap-2004-06-22/tests/mutex6rs.c ./tests/mutex6rs.c
738 --- ../pthreads-snap-2004-06-22/tests/mutex6rs.c        2004-06-22 08:12:55.000000000 +0200
739 +++ ./tests/mutex6rs.c  2009-01-07 15:57:36.000000000 +0100
740 @@ -72,7 +72,7 @@
741  main()
742  {
743    pthread_t t;
744 -  int result = 0;
745 +  DWORD_PTR result = 0;
746  
747    assert(mutex == PTHREAD_RECURSIVE_MUTEX_INITIALIZER);
748  
749 diff -Naur ../pthreads-snap-2004-06-22/tests/mutex7e.c ./tests/mutex7e.c
750 --- ../pthreads-snap-2004-06-22/tests/mutex7e.c 2003-08-19 05:31:51.000000000 +0200
751 +++ ./tests/mutex7e.c   2009-01-07 15:57:36.000000000 +0100
752 @@ -74,7 +74,7 @@
753  main()
754  {
755    pthread_t t;
756 -  int result = 0;
757 +  DWORD_PTR result = 0;
758    int mxType = -1;
759  
760    assert(pthread_mutexattr_init(&mxAttr) == 0);
761 diff -Naur ../pthreads-snap-2004-06-22/tests/mutex7r.c ./tests/mutex7r.c
762 --- ../pthreads-snap-2004-06-22/tests/mutex7r.c 2003-08-19 05:31:51.000000000 +0200
763 +++ ./tests/mutex7r.c   2009-01-07 15:57:36.000000000 +0100
764 @@ -73,7 +73,7 @@
765  main()
766  {
767    pthread_t t;
768 -  int result = 0;
769 +  DWORD_PTR result = 0;
770    int mxType = -1;
771  
772    assert(pthread_mutexattr_init(&mxAttr) == 0);
773 diff -Naur ../pthreads-snap-2004-06-22/tests/mutex8.c ./tests/mutex8.c
774 --- ../pthreads-snap-2004-06-22/tests/mutex8.c  2002-02-20 05:39:56.000000000 +0100
775 +++ ./tests/mutex8.c    2009-01-07 15:57:36.000000000 +0100
776 @@ -49,7 +49,7 @@
777  
778    _ftime(&currSysTime);
779  
780 -  abstime.tv_sec = currSysTime.time;
781 +  abstime.tv_sec = (long)currSysTime.time;
782    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
783  
784    abstime.tv_sec += 1;
785 diff -Naur ../pthreads-snap-2004-06-22/tests/mutex8e.c ./tests/mutex8e.c
786 --- ../pthreads-snap-2004-06-22/tests/mutex8e.c 2002-02-20 05:39:56.000000000 +0100
787 +++ ./tests/mutex8e.c   2009-01-07 15:57:36.000000000 +0100
788 @@ -57,7 +57,7 @@
789  
790    _ftime(&currSysTime);
791  
792 -  abstime.tv_sec = currSysTime.time;
793 +  abstime.tv_sec = (long)currSysTime.time;
794    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
795  
796    abstime.tv_sec += 1;
797 diff -Naur ../pthreads-snap-2004-06-22/tests/mutex8n.c ./tests/mutex8n.c
798 --- ../pthreads-snap-2004-06-22/tests/mutex8n.c 2002-02-20 05:39:56.000000000 +0100
799 +++ ./tests/mutex8n.c   2009-01-07 15:57:36.000000000 +0100
800 @@ -57,7 +57,7 @@
801  
802    _ftime(&currSysTime);
803  
804 -  abstime.tv_sec = currSysTime.time;
805 +  abstime.tv_sec = (long)currSysTime.time;
806    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
807  
808    abstime.tv_sec += 1;
809 diff -Naur ../pthreads-snap-2004-06-22/tests/mutex8r.c ./tests/mutex8r.c
810 --- ../pthreads-snap-2004-06-22/tests/mutex8r.c 2002-02-20 05:39:56.000000000 +0100
811 +++ ./tests/mutex8r.c   2009-01-07 15:57:36.000000000 +0100
812 @@ -57,7 +57,7 @@
813  
814    _ftime(&currSysTime);
815  
816 -  abstime.tv_sec = currSysTime.time;
817 +  abstime.tv_sec = (long)currSysTime.time;
818    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
819  
820    abstime.tv_sec += 1;
821 diff -Naur ../pthreads-snap-2004-06-22/tests/rwlock2_t.c ./tests/rwlock2_t.c
822 --- ../pthreads-snap-2004-06-22/tests/rwlock2_t.c       2003-08-19 05:31:51.000000000 +0200
823 +++ ./tests/rwlock2_t.c 2009-01-07 15:57:36.000000000 +0100
824 @@ -55,7 +55,7 @@
825  
826    _ftime(&currSysTime);
827  
828 -  abstime.tv_sec = currSysTime.time;
829 +  abstime.tv_sec = (long)currSysTime.time;
830    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
831  
832    abstime.tv_sec += 1;
833 diff -Naur ../pthreads-snap-2004-06-22/tests/rwlock3_t.c ./tests/rwlock3_t.c
834 --- ../pthreads-snap-2004-06-22/tests/rwlock3_t.c       2003-08-19 05:31:51.000000000 +0200
835 +++ ./tests/rwlock3_t.c 2009-01-07 15:57:36.000000000 +0100
836 @@ -68,7 +68,7 @@
837  
838    _ftime(&currSysTime);
839  
840 -  abstime.tv_sec = currSysTime.time;
841 +  abstime.tv_sec = (long)currSysTime.time;
842    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
843  
844    abstime.tv_sec += 1;
845 diff -Naur ../pthreads-snap-2004-06-22/tests/rwlock4_t.c ./tests/rwlock4_t.c
846 --- ../pthreads-snap-2004-06-22/tests/rwlock4_t.c       2003-08-19 05:31:51.000000000 +0200
847 +++ ./tests/rwlock4_t.c 2009-01-07 15:57:36.000000000 +0100
848 @@ -68,7 +68,7 @@
849  
850    _ftime(&currSysTime);
851  
852 -  abstime.tv_sec = currSysTime.time;
853 +  abstime.tv_sec = (long)currSysTime.time;
854    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
855  
856    abstime.tv_sec += 1;
857 diff -Naur ../pthreads-snap-2004-06-22/tests/rwlock5_t.c ./tests/rwlock5_t.c
858 --- ../pthreads-snap-2004-06-22/tests/rwlock5_t.c       2003-08-19 05:31:51.000000000 +0200
859 +++ ./tests/rwlock5_t.c 2009-01-07 15:57:36.000000000 +0100
860 @@ -70,7 +70,7 @@
861  
862    _ftime(&currSysTime);
863  
864 -  abstime.tv_sec = currSysTime.time;
865 +  abstime.tv_sec = (long)currSysTime.time;
866    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
867  
868    abstime.tv_sec += 1;
869 diff -Naur ../pthreads-snap-2004-06-22/tests/rwlock6.c ./tests/rwlock6.c
870 --- ../pthreads-snap-2004-06-22/tests/rwlock6.c 2003-08-19 05:31:51.000000000 +0200
871 +++ ./tests/rwlock6.c   2009-01-07 15:57:36.000000000 +0100
872 @@ -77,9 +77,9 @@
873    pthread_t wrt1;
874    pthread_t wrt2;
875    pthread_t rdt;
876 -  int wr1Result = 0;
877 -  int wr2Result = 0;
878 -  int rdResult = 0;
879 +  DWORD_PTR wr1Result = 0;
880 +  DWORD_PTR wr2Result = 0;
881 +  DWORD_PTR rdResult = 0;
882  
883    bankAccount = 0;
884  
885 diff -Naur ../pthreads-snap-2004-06-22/tests/rwlock6_t2.c ./tests/rwlock6_t2.c
886 --- ../pthreads-snap-2004-06-22/tests/rwlock6_t2.c      2003-08-19 05:31:51.000000000 +0200
887 +++ ./tests/rwlock6_t2.c        2009-01-07 15:57:36.000000000 +0100
888 @@ -86,15 +86,15 @@
889    pthread_t wrt1;
890    pthread_t wrt2;
891    pthread_t rdt;
892 -  int wr1Result = 0;
893 -  int wr2Result = 0;
894 -  int rdResult = 0;
895 +  DWORD_PTR wr1Result = 0;
896 +  DWORD_PTR wr2Result = 0;
897 +  DWORD_PTR rdResult = 0;
898    struct _timeb currSysTime;
899    const DWORD NANOSEC_PER_MILLISEC = 1000000;
900  
901    _ftime(&currSysTime);
902  
903 -  abstime.tv_sec = currSysTime.time;
904 +  abstime.tv_sec = (long)currSysTime.time;
905    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
906  
907    abstime.tv_sec += 1;
908 diff -Naur ../pthreads-snap-2004-06-22/tests/rwlock6_t.c ./tests/rwlock6_t.c
909 --- ../pthreads-snap-2004-06-22/tests/rwlock6_t.c       2003-08-19 05:31:51.000000000 +0200
910 +++ ./tests/rwlock6_t.c 2009-01-07 15:57:36.000000000 +0100
911 @@ -67,7 +67,7 @@
912  
913    _ftime(&currSysTime);
914  
915 -  abstime.tv_sec = currSysTime.time;
916 +  abstime.tv_sec = (long)currSysTime.time;
917    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
918  
919  
920 @@ -95,10 +95,10 @@
921    pthread_t wrt2;
922    pthread_t rdt1;
923    pthread_t rdt2;
924 -  int wr1Result = 0;
925 -  int wr2Result = 0;
926 -  int rd1Result = 0;
927 -  int rd2Result = 0;
928 +  DWORD_PTR wr1Result = 0;
929 +  DWORD_PTR wr2Result = 0;
930 +  DWORD_PTR rd1Result = 0;
931 +  DWORD_PTR rd2Result = 0;
932  
933    bankAccount = 0;
934  
935 diff -Naur ../pthreads-snap-2004-06-22/tests/semaphore1.c ./tests/semaphore1.c
936 --- ../pthreads-snap-2004-06-22/tests/semaphore1.c      2003-08-19 05:31:51.000000000 +0200
937 +++ ./tests/semaphore1.c        2009-01-07 15:57:36.000000000 +0100
938 @@ -117,7 +117,7 @@
939  {
940    pthread_t t;
941    sem_t s;
942 -  int result;
943 +  DWORD_PTR result;
944  
945    assert(pthread_create(&t, NULL, thr, NULL) == 0);
946    assert(pthread_join(t, (void **)&result) == 0);
947 diff -Naur ../pthreads-snap-2004-06-22/tests/spin4.c ./tests/spin4.c
948 --- ../pthreads-snap-2004-06-22/tests/spin4.c   2003-08-19 05:31:51.000000000 +0200
949 +++ ./tests/spin4.c     2009-01-07 15:57:36.000000000 +0100
950 @@ -63,7 +63,7 @@
951  int
952  main()
953  {
954 -  long result = 0;
955 +  DWORD_PTR result = 0;
956    pthread_t t;
957    int CPUs;
958    struct _timeb sysTime;
959 diff -Naur ../pthreads-snap-2004-06-22/tests/tsd1.c ./tests/tsd1.c
960 --- ../pthreads-snap-2004-06-22/tests/tsd1.c    2003-08-19 05:31:51.000000000 +0200
961 +++ ./tests/tsd1.c      2009-01-07 15:57:36.000000000 +0100
962 @@ -171,7 +171,7 @@
963     */
964    for (i = 1; i < 10; i++)
965      {
966 -       int result = 0;
967 +       DWORD_PTR result = 0;
968  
969         assert(pthread_join(thread[i], (void **) &result) == 0);
970      }