]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/win32/patches/pthreads-w64+bacula.patch
ebl Patch to compile pthread with mingw-w64
[bacula/bacula] / bacula / src / win32 / patches / pthreads-w64+bacula.patch
1 diff -Naur pthreads-snap-2004-06-22/GNUmakefile pthreads-snap-2004-06-22_w64+bacula-patch/GNUmakefile
2 --- pthreads-snap-2004-06-22/GNUmakefile        2004-05-20 02:56:52.000000000 +0200
3 +++ pthreads-snap-2004-06-22_w64+bacula-patch/GNUmakefile       2009-01-06 17:17:19.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 pthreads-snap-2004-06-22_w64+bacula-patch/implement.h
71 --- pthreads-snap-2004-06-22/implement.h        2004-06-22 08:12:54.000000000 +0200
72 +++ pthreads-snap-2004-06-22_w64+bacula-patch/implement.h       2009-01-06 17:21:14.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 pthreads-snap-2004-06-22_w64+bacula-patch/pthread_cancel.c
84 --- pthreads-snap-2004-06-22/pthread_cancel.c   2004-05-17 03:38:02.000000000 +0200
85 +++ pthreads-snap-2004-06-22_w64+bacula-patch/pthread_cancel.c  2009-01-06 17:17: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_getspecific.c pthreads-snap-2004-06-22_w64+bacula-patch/pthread_getspecific.c
96 --- pthreads-snap-2004-06-22/pthread_getspecific.c      2004-05-17 03:38:03.000000000 +0200
97 +++ pthreads-snap-2004-06-22_w64+bacula-patch/pthread_getspecific.c     2009-01-06 17:17:19.000000000 +0100
98 @@ -63,13 +63,18 @@
99        * ------------------------------------------------------
100        */
101  {
102 -  int lasterror = GetLastError ();
103 -  int lastWSAerror = WSAGetLastError ();
104 +  void *ptr;
105  
106 -  void *ptr = TlsGetValue (key->key);
107 +  if (key == NULL) {
108 +     ptr = NULL;
109 +  } else {
110 +     int lasterror = GetLastError ();
111 +     int lastWSAerror = WSAGetLastError ();
112  
113 -  SetLastError (lasterror);
114 -  WSASetLastError (lastWSAerror);
115 +     ptr = TlsGetValue(key->key);
116  
117 +     SetLastError(lasterror);
118 +     WSASetLastError(lastWSAerror);
119 +  }
120    return ptr;
121  }
122 diff -Naur pthreads-snap-2004-06-22/pthread.h pthreads-snap-2004-06-22_w64+bacula-patch/pthread.h
123 --- pthreads-snap-2004-06-22/pthread.h  2004-06-22 08:12:54.000000000 +0200
124 +++ pthreads-snap-2004-06-22_w64+bacula-patch/pthread.h 2009-01-06 17:17:19.000000000 +0100
125 @@ -274,10 +274,6 @@
126  #endif /* PTW32_LEVEL >= PTW32_LEVEL_MAX */
127  
128  #ifndef HAVE_STRUCT_TIMESPEC
129 -struct timespec {
130 -        long tv_sec;
131 -        long tv_nsec;
132 -};
133  #endif /* HAVE_STRUCT_TIMESPEC */
134  
135  #ifndef SIG_BLOCK
136 diff -Naur pthreads-snap-2004-06-22/ptw32_InterlockedCompareExchange.c pthreads-snap-2004-06-22_w64+bacula-patch/ptw32_InterlockedCompareExchange.c
137 --- pthreads-snap-2004-06-22/ptw32_InterlockedCompareExchange.c 2004-05-17 03:38:03.000000000 +0200
138 +++ pthreads-snap-2004-06-22_w64+bacula-patch/ptw32_InterlockedCompareExchange.c        2009-01-06 17:17:19.000000000 +0100
139 @@ -101,6 +101,19 @@
140  #endif
141  
142  #else
143 +#if defined(_WIN64)
144 +   /*
145 +    * Microsoft Visual C++ 7.1 and newer have _Interlocked intrinsics
146 +    */
147 +       {
148 +               result = InterlockedCompareExchange(LONG volatile *Destination,LONG ExChange,LONG Comperand);
149 +       }
150 +       else
151 +       {
152 +               result = InterlockedCompareExchange(LONG volatile *Destination,LONG ExChange,LONG Comperand);
153 +       }
154 + #else
155 +
156  
157    /*
158     * If execution gets to here then we should be running on a Win95 system
159 @@ -110,7 +123,8 @@
160     */
161  
162    result = 0;
163 -
164 +#error Unsupported platform or compiler!
165 +#endif
166  #endif
167  
168  /* *INDENT-ON* */
169 diff -Naur pthreads-snap-2004-06-22/ptw32_semwait.c pthreads-snap-2004-06-22_w64+bacula-patch/ptw32_semwait.c
170 --- pthreads-snap-2004-06-22/ptw32_semwait.c    2004-05-17 09:59:47.000000000 +0200
171 +++ pthreads-snap-2004-06-22_w64+bacula-patch/ptw32_semwait.c   2009-01-06 17:17:19.000000000 +0100
172 @@ -41,7 +41,7 @@
173  #include "implement.h"
174  
175  
176 -INLINE int
177 +int
178  ptw32_semwait (sem_t * sem)
179       /*
180        * ------------------------------------------------------
181 diff -Naur pthreads-snap-2004-06-22/ptw32_threadStart.c pthreads-snap-2004-06-22_w64+bacula-patch/ptw32_threadStart.c
182 --- pthreads-snap-2004-06-22/ptw32_threadStart.c        2004-05-17 03:38:03.000000000 +0200
183 +++ pthreads-snap-2004-06-22_w64+bacula-patch/ptw32_threadStart.c       2009-01-06 17:45:27.000000000 +0100
184 @@ -356,7 +356,7 @@
185      }
186  
187  #if ! defined (__MINGW32__) || defined (__MSVCRT__)
188 -  _endthreadex ((unsigned) status);
189 +  _endthreadex ((unsigned) ((ULONG_PTR)status));
190  #else
191    _endthread ();
192  #endif
193 @@ -366,7 +366,7 @@
194     */
195  
196  #if ! defined (__MINGW32__) || defined (__MSVCRT__)
197 -  return (unsigned) status;
198 +  return (unsigned) ((ULONG_PTR)status);
199  #endif
200  
201  }                              /* ptw32_threadStart */
202 diff -Naur pthreads-snap-2004-06-22/ptw32_throw.c pthreads-snap-2004-06-22_w64+bacula-patch/ptw32_throw.c
203 --- pthreads-snap-2004-06-22/ptw32_throw.c      2004-05-17 03:38:03.000000000 +0200
204 +++ pthreads-snap-2004-06-22_w64+bacula-patch/ptw32_throw.c     2009-01-06 17:47:37.000000000 +0100
205 @@ -78,10 +78,10 @@
206        switch (exception)
207         {
208         case PTW32_EPS_CANCEL:
209 -         exitCode = (unsigned) PTHREAD_CANCELED;
210 +         exitCode = (unsigned) ((ULONG_PTR)PTHREAD_CANCELED);
211           break;
212         case PTW32_EPS_EXIT:
213 -         exitCode = (unsigned) self->exitStatus;;
214 +         exitCode = (unsigned) ((ULONG_PTR)self->exitStatus);;
215           break;
216         }
217  
218 diff -Naur pthreads-snap-2004-06-22/tests/barrier3.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/barrier3.c
219 --- pthreads-snap-2004-06-22/tests/barrier3.c   2003-08-19 05:31:51.000000000 +0200
220 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/barrier3.c  2009-01-06 17:17:19.000000000 +0100
221 @@ -41,7 +41,7 @@
222  #include "test.h"
223   
224  pthread_barrier_t barrier = NULL;
225 -static int result = 1;
226 +static DWORD_PTR result = 1;
227  
228  void * func(void * arg)
229  {
230 diff -Naur pthreads-snap-2004-06-22/tests/barrier5.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/barrier5.c
231 --- pthreads-snap-2004-06-22/tests/barrier5.c   2003-08-19 05:31:51.000000000 +0200
232 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/barrier5.c  2009-01-06 17:17:19.000000000 +0100
233 @@ -90,7 +90,7 @@
234  main()
235  {
236    int i, j;
237 -  int result;
238 +  DWORD_PTR result;
239    int serialThreadsTotal;
240    pthread_t t[NUMTHREADS + 1];
241  
242 @@ -112,7 +112,7 @@
243        for (i = 1; i <= j; i++)
244          {
245            assert(pthread_join(t[i], (void **) &result) == 0);
246 -          serialThreadsTotal += result;
247 +           serialThreadsTotal += (int)result;
248          }
249  
250        assert(serialThreadsTotal == BARRIERS - 1);
251 diff -Naur pthreads-snap-2004-06-22/tests/cancel2.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/cancel2.c
252 --- pthreads-snap-2004-06-22/tests/cancel2.c    2003-08-19 05:31:51.000000000 +0200
253 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/cancel2.c   2009-01-06 17:17:19.000000000 +0100
254 @@ -217,7 +217,7 @@
255    for (i = 1; i <= NUMTHREADS; i++)
256      {
257        int fail = 0;
258 -      int result = 0;
259 +      DWORD_PTR result = 0;
260  
261        assert(pthread_join(t[i], (void **) &result) == 0);
262        fail = (result != (int) PTHREAD_CANCELED);
263 diff -Naur pthreads-snap-2004-06-22/tests/cancel3.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/cancel3.c
264 --- pthreads-snap-2004-06-22/tests/cancel3.c    2004-05-17 03:38:03.000000000 +0200
265 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/cancel3.c   2009-01-06 17:17:19.000000000 +0100
266 @@ -173,7 +173,7 @@
267    for (i = 1; i <= NUMTHREADS; i++)
268      {
269        int fail = 0;
270 -      int result = 0;
271 +      DWORD_PTR result = 0;
272  
273        /*
274         * The thread does not contain any cancelation points, so
275 diff -Naur pthreads-snap-2004-06-22/tests/cancel4.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/cancel4.c
276 --- pthreads-snap-2004-06-22/tests/cancel4.c    2004-05-17 03:38:03.000000000 +0200
277 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/cancel4.c   2009-01-06 17:17:19.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/cancel5.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/cancel5.c
288 --- pthreads-snap-2004-06-22/tests/cancel5.c    2004-05-17 03:38:03.000000000 +0200
289 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/cancel5.c   2009-01-06 17:17:19.000000000 +0100
290 @@ -171,7 +171,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/cancel6a.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/cancel6a.c
300 --- pthreads-snap-2004-06-22/tests/cancel6a.c   2004-05-17 03:38:03.000000000 +0200
301 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/cancel6a.c  2009-01-06 17:17:19.000000000 +0100
302 @@ -161,7 +161,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/cancel6d.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/cancel6d.c
312 --- pthreads-snap-2004-06-22/tests/cancel6d.c   2004-05-17 03:38:03.000000000 +0200
313 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/cancel6d.c  2009-01-06 17:17:19.000000000 +0100
314 @@ -165,7 +165,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/cleanup0.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/cleanup0.c
324 --- pthreads-snap-2004-06-22/tests/cleanup0.c   2003-08-19 05:31:51.000000000 +0200
325 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/cleanup0.c  2009-01-06 17:17:19.000000000 +0100
326 @@ -180,7 +180,7 @@
327    for (i = 1; i <= NUMTHREADS; i++)
328      {
329        int fail = 0;
330 -      int result = 0;
331 +      DWORD_PTR result = 0;
332  
333        assert(pthread_join(t[i], (void **) &result) == 0);
334  
335 diff -Naur pthreads-snap-2004-06-22/tests/cleanup1.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/cleanup1.c
336 --- pthreads-snap-2004-06-22/tests/cleanup1.c   2003-08-19 05:31:51.000000000 +0200
337 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/cleanup1.c  2009-01-06 17:17:19.000000000 +0100
338 @@ -195,7 +195,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/cleanup2.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/cleanup2.c
348 --- pthreads-snap-2004-06-22/tests/cleanup2.c   2003-08-19 05:31:51.000000000 +0200
349 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/cleanup2.c  2009-01-06 17:17:19.000000000 +0100
350 @@ -169,7 +169,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/cleanup3.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/cleanup3.c
360 --- pthreads-snap-2004-06-22/tests/cleanup3.c   2003-08-19 05:31:51.000000000 +0200
361 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/cleanup3.c  2009-01-06 17:17:19.000000000 +0100
362 @@ -172,7 +172,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/condvar1_2.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/condvar1_2.c
372 --- pthreads-snap-2004-06-22/tests/condvar1_2.c 2003-08-19 05:31:51.000000000 +0200
373 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/condvar1_2.c        2009-01-06 17:17:19.000000000 +0100
374 @@ -89,7 +89,7 @@
375  main()
376  {
377    int i, j, k;
378 -  int result = -1;
379 +  DWORD_PTR result = -1;
380    pthread_t t;
381  
382    for (k = 0; k < NUM_LOOPS; k++)
383 diff -Naur pthreads-snap-2004-06-22/tests/condvar2_1.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/condvar2_1.c
384 --- pthreads-snap-2004-06-22/tests/condvar2_1.c 2004-05-20 02:56:52.000000000 +0200
385 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/condvar2_1.c        2009-01-06 17:17:19.000000000 +0100
386 @@ -105,7 +105,7 @@
387  {
388    int i;
389    pthread_t t[NUMTHREADS + 1];
390 -  int result = 0;
391 +  DWORD_PTR result = 0;
392    struct _timeb currSysTime;
393    const DWORD NANOSEC_PER_MILLISEC = 1000000;
394  
395 @@ -116,7 +116,7 @@
396    /* get current system time */
397    _ftime(&currSysTime);
398  
399 -  abstime.tv_sec = currSysTime.time;
400 +  abstime.tv_sec = (long)currSysTime.time;
401    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
402  
403    abstime.tv_sec += 5;
404 diff -Naur pthreads-snap-2004-06-22/tests/condvar2.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/condvar2.c
405 --- pthreads-snap-2004-06-22/tests/condvar2.c   2004-05-20 02:56:52.000000000 +0200
406 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/condvar2.c  2009-01-06 17:17:19.000000000 +0100
407 @@ -99,7 +99,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 @@ -109,7 +109,7 @@
417    assert(pthread_mutex_unlock(&mutex) == 0);
418  
419    {
420 -  int result = pthread_cond_destroy(&cv);
421 +  DWORD_PTR result = pthread_cond_destroy(&cv);
422    if (result != 0)
423      {
424        fprintf(stderr, "Result = %s\n", error_string[result]);
425 diff -Naur pthreads-snap-2004-06-22/tests/condvar3_1.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/condvar3_1.c
426 --- pthreads-snap-2004-06-22/tests/condvar3_1.c 2004-05-20 02:56:52.000000000 +0200
427 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/condvar3_1.c        2009-01-06 17:17:19.000000000 +0100
428 @@ -125,7 +125,7 @@
429  {
430    int i;
431    pthread_t t[NUMTHREADS + 1];
432 -  int result = 0;
433 +  DWORD_PTR result = 0;
434    struct _timeb currSysTime;
435    const DWORD NANOSEC_PER_MILLISEC = 1000000;
436  
437 @@ -137,7 +137,7 @@
438    /* get current system time */
439    _ftime(&currSysTime);
440  
441 -  abstime.tv_sec = currSysTime.time;
442 +  abstime.tv_sec = (long)currSysTime.time;
443    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
444  
445    abstime.tv_sec += 5;
446 diff -Naur pthreads-snap-2004-06-22/tests/condvar3_2.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/condvar3_2.c
447 --- pthreads-snap-2004-06-22/tests/condvar3_2.c 2004-05-20 02:56:52.000000000 +0200
448 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/condvar3_2.c        2009-01-06 17:17:19.000000000 +0100
449 @@ -127,7 +127,7 @@
450  {
451    int i;
452    pthread_t t[NUMTHREADS + 1];
453 -  int result = 0;
454 +  DWORD_PTR result = 0;
455    struct _timeb currSysTime;
456    const DWORD NANOSEC_PER_MILLISEC = 1000000;
457  
458 @@ -138,7 +138,7 @@
459    /* get current system time */
460    _ftime(&currSysTime);
461  
462 -  abstime.tv_sec = abstime.tv_sec = currSysTime.time + 5;
463 +  abstime.tv_sec = abstime.tv_sec = (long)currSysTime.time + 5;
464    abstime.tv_nsec = abstime2.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
465  
466    assert(pthread_mutex_lock(&mutex) == 0);
467 diff -Naur pthreads-snap-2004-06-22/tests/condvar3_3.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/condvar3_3.c
468 --- pthreads-snap-2004-06-22/tests/condvar3_3.c 2003-08-19 05:31:51.000000000 +0200
469 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/condvar3_3.c        2009-01-06 17:17:19.000000000 +0100
470 @@ -96,7 +96,7 @@
471     /* get current system time */
472     _ftime(&currSysTime);
473  
474 -   abstime.tv_sec = currSysTime.time;
475 +   abstime.tv_sec = (long)currSysTime.time;
476     abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
477     abstime.tv_sec += 1;
478  
479 @@ -120,7 +120,7 @@
480  
481     assert(pthread_mutex_lock(&mtx) == 0);
482  
483 -   abstime.tv_sec = currSysTime.time;
484 +   abstime.tv_sec = (long)currSysTime.time;
485     abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
486     abstime.tv_sec += 1;
487  
488 diff -Naur pthreads-snap-2004-06-22/tests/condvar3.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/condvar3.c
489 --- pthreads-snap-2004-06-22/tests/condvar3.c   2003-08-19 05:31:51.000000000 +0200
490 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/condvar3.c  2009-01-06 17:17:19.000000000 +0100
491 @@ -127,7 +127,7 @@
492    /* get current system time */
493    _ftime(&currSysTime);
494  
495 -  abstime.tv_sec = currSysTime.time;
496 +  abstime.tv_sec = (long)currSysTime.time;
497    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
498  
499    assert(pthread_create(&t[1], NULL, mythread, (void *) 1) == 0);
500 diff -Naur pthreads-snap-2004-06-22/tests/condvar4.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/condvar4.c
501 --- pthreads-snap-2004-06-22/tests/condvar4.c   2003-08-19 05:31:51.000000000 +0200
502 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/condvar4.c  2009-01-06 17:17:19.000000000 +0100
503 @@ -132,7 +132,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    abstime.tv_sec += 5;
512 @@ -145,7 +145,7 @@
513  
514    _ftime(&currSysTime);
515  
516 -  abstime.tv_sec = currSysTime.time;
517 +  abstime.tv_sec = (long)currSysTime.time;
518    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
519  
520    abstime.tv_sec += 5;
521 diff -Naur pthreads-snap-2004-06-22/tests/condvar5.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/condvar5.c
522 --- pthreads-snap-2004-06-22/tests/condvar5.c   2003-08-19 05:31:51.000000000 +0200
523 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/condvar5.c  2009-01-06 17:17:19.000000000 +0100
524 @@ -131,7 +131,7 @@
525    /* get current system time */
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 @@ -144,7 +144,7 @@
534  
535    _ftime(&currSysTime);
536  
537 -  abstime.tv_sec = currSysTime.time;
538 +  abstime.tv_sec = (long)currSysTime.time;
539    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
540  
541    abstime.tv_sec += 5;
542 diff -Naur pthreads-snap-2004-06-22/tests/condvar6.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/condvar6.c
543 --- pthreads-snap-2004-06-22/tests/condvar6.c   2003-08-19 05:31:51.000000000 +0200
544 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/condvar6.c  2009-01-06 17:17:19.000000000 +0100
545 @@ -159,7 +159,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/condvar7.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/condvar7.c
555 --- pthreads-snap-2004-06-22/tests/condvar7.c   2003-08-19 05:31:51.000000000 +0200
556 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/condvar7.c  2009-01-06 17:17:19.000000000 +0100
557 @@ -169,7 +169,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 += 10;
566 diff -Naur pthreads-snap-2004-06-22/tests/condvar8.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/condvar8.c
567 --- pthreads-snap-2004-06-22/tests/condvar8.c   2003-08-19 05:31:51.000000000 +0200
568 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/condvar8.c  2009-01-06 17:17:19.000000000 +0100
569 @@ -166,7 +166,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/condvar9.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/condvar9.c
579 --- pthreads-snap-2004-06-22/tests/condvar9.c   2003-08-19 05:31:51.000000000 +0200
580 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/condvar9.c  2009-01-06 17:17:19.000000000 +0100
581 @@ -172,7 +172,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 += 5;
590 diff -Naur pthreads-snap-2004-06-22/tests/context1.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/context1.c
591 --- pthreads-snap-2004-06-22/tests/context1.c   2004-05-20 02:56:52.000000000 +0200
592 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/context1.c  2009-01-06 17:17:19.000000000 +0100
593 @@ -125,7 +125,11 @@
594        /*
595         *_x86 only!!!
596         */
597 +#if defined(_M_IX86)
598        context.Eip = (DWORD) anotherEnding;
599 +#else
600 +      context.Rip = (DWORD64) anotherEnding;
601 +#endif
602        SetThreadContext(hThread, &context);
603        ResumeThread(hThread);
604      }
605 diff -Naur pthreads-snap-2004-06-22/tests/delay2.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/delay2.c
606 --- pthreads-snap-2004-06-22/tests/delay2.c     2003-08-19 05:31:51.000000000 +0200
607 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/delay2.c    2009-01-06 17:17:19.000000000 +0100
608 @@ -65,7 +65,7 @@
609  main(int argc, char * argv[])
610  {
611    pthread_t t;
612 -  int result = 0;
613 +  DWORD_PTR result = 0;
614  
615    assert(pthread_mutex_lock(&mx) == 0);
616  
617 diff -Naur pthreads-snap-2004-06-22/tests/exception1.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/exception1.c
618 --- pthreads-snap-2004-06-22/tests/exception1.c 2003-08-19 05:31:51.000000000 +0200
619 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/exception1.c        2009-01-06 17:17:19.000000000 +0100
620 @@ -226,7 +226,7 @@
621    for (i = 0; i < NUMTHREADS; i++)
622      {
623        int fail = 0;
624 -      int result = 0;
625 +      DWORD_PTR result = 0;
626  
627         /* Canceled thread */
628        assert(pthread_join(ct[i], (void **) &result) == 0);
629 diff -Naur pthreads-snap-2004-06-22/tests/GNUmakefile pthreads-snap-2004-06-22_w64+bacula-patch/tests/GNUmakefile
630 --- pthreads-snap-2004-06-22/tests/GNUmakefile  2004-06-22 08:12:55.000000000 +0200
631 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/GNUmakefile 2009-01-06 17:17:19.000000000 +0100
632 @@ -64,7 +64,7 @@
633  DLL    = pthread$(GCX).dll
634  QAPC   = ../QueueUserAPCEx/User/quserex.dll
635  
636 -COPYFILES      = $(HDR) $(LIB) $(DLL) $(QAPC)
637 +COPYFILES      = $(HDR) $(LIB) $(DLL)
638  
639  # If a test case returns a non-zero exit code to the shell, make will
640  # stop.
641 diff -Naur pthreads-snap-2004-06-22/tests/join0.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/join0.c
642 --- pthreads-snap-2004-06-22/tests/join0.c      2003-08-19 05:31:51.000000000 +0200
643 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/join0.c     2009-01-06 17:17:19.000000000 +0100
644 @@ -53,7 +53,7 @@
645  main(int argc, char * argv[])
646  {
647    pthread_t id;
648 -  int result;
649 +  DWORD_PTR result;
650  
651    /* Create a single thread and wait for it to exit. */
652    assert(pthread_create(&id, NULL, func, (void *) 123) == 0);
653 diff -Naur pthreads-snap-2004-06-22/tests/join1.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/join1.c
654 --- pthreads-snap-2004-06-22/tests/join1.c      2003-08-19 05:31:51.000000000 +0200
655 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/join1.c     2009-01-06 17:17:19.000000000 +0100
656 @@ -56,7 +56,7 @@
657  {
658         pthread_t id[4];
659         int i;
660 -       int result;
661 +       DWORD_PTR result;
662  
663         /* Create a few threads and then exit. */
664         for (i = 0; i < 4; i++)
665 diff -Naur pthreads-snap-2004-06-22/tests/join2.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/join2.c
666 --- pthreads-snap-2004-06-22/tests/join2.c      2003-08-19 05:31:51.000000000 +0200
667 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/join2.c     2009-01-06 17:17:19.000000000 +0100
668 @@ -50,7 +50,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/join3.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/join3.c
678 --- pthreads-snap-2004-06-22/tests/join3.c      2004-05-22 03:17:58.000000000 +0200
679 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/join3.c     2009-01-06 17:17:19.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/mutex6e.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/mutex6e.c
690 --- pthreads-snap-2004-06-22/tests/mutex6e.c    2003-08-19 05:31:51.000000000 +0200
691 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/mutex6e.c   2009-01-06 17:17:19.000000000 +0100
692 @@ -74,7 +74,7 @@
693  main()
694  {
695    pthread_t t;
696 -  int result = 0;
697 +  DWORD_PTR result = 0;
698    int mxType = -1;
699  
700    assert(pthread_mutexattr_init(&mxAttr) == 0);
701 diff -Naur pthreads-snap-2004-06-22/tests/mutex6es.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/mutex6es.c
702 --- pthreads-snap-2004-06-22/tests/mutex6es.c   2004-06-22 08:12:55.000000000 +0200
703 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/mutex6es.c  2009-01-06 17:17:19.000000000 +0100
704 @@ -73,7 +73,7 @@
705  main()
706  {
707    pthread_t t;
708 -  int result = 0;
709 +  DWORD_PTR result = 0;
710  
711    assert(mutex == PTHREAD_ERRORCHECK_MUTEX_INITIALIZER);
712  
713 diff -Naur pthreads-snap-2004-06-22/tests/mutex6r.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/mutex6r.c
714 --- pthreads-snap-2004-06-22/tests/mutex6r.c    2003-08-19 05:31:51.000000000 +0200
715 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/mutex6r.c   2009-01-06 17:17:19.000000000 +0100
716 @@ -73,7 +73,7 @@
717  main()
718  {
719    pthread_t t;
720 -  int result = 0;
721 +  DWORD_PTR result = 0;
722    int mxType = -1;
723  
724    assert(pthread_mutexattr_init(&mxAttr) == 0);
725 diff -Naur pthreads-snap-2004-06-22/tests/mutex6rs.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/mutex6rs.c
726 --- pthreads-snap-2004-06-22/tests/mutex6rs.c   2004-06-22 08:12:55.000000000 +0200
727 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/mutex6rs.c  2009-01-06 17:17:19.000000000 +0100
728 @@ -72,7 +72,7 @@
729  main()
730  {
731    pthread_t t;
732 -  int result = 0;
733 +  DWORD_PTR result = 0;
734  
735    assert(mutex == PTHREAD_RECURSIVE_MUTEX_INITIALIZER);
736  
737 diff -Naur pthreads-snap-2004-06-22/tests/mutex7e.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/mutex7e.c
738 --- pthreads-snap-2004-06-22/tests/mutex7e.c    2003-08-19 05:31:51.000000000 +0200
739 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/mutex7e.c   2009-01-06 17:17:19.000000000 +0100
740 @@ -74,7 +74,7 @@
741  main()
742  {
743    pthread_t t;
744 -  int result = 0;
745 +  DWORD_PTR result = 0;
746    int mxType = -1;
747  
748    assert(pthread_mutexattr_init(&mxAttr) == 0);
749 diff -Naur pthreads-snap-2004-06-22/tests/mutex7r.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/mutex7r.c
750 --- pthreads-snap-2004-06-22/tests/mutex7r.c    2003-08-19 05:31:51.000000000 +0200
751 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/mutex7r.c   2009-01-06 17:17:19.000000000 +0100
752 @@ -73,7 +73,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/mutex8.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/mutex8.c
762 --- pthreads-snap-2004-06-22/tests/mutex8.c     2002-02-20 05:39:56.000000000 +0100
763 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/mutex8.c    2009-01-06 17:17:19.000000000 +0100
764 @@ -49,7 +49,7 @@
765  
766    _ftime(&currSysTime);
767  
768 -  abstime.tv_sec = currSysTime.time;
769 +  abstime.tv_sec = (long)currSysTime.time;
770    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
771  
772    abstime.tv_sec += 1;
773 diff -Naur pthreads-snap-2004-06-22/tests/mutex8e.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/mutex8e.c
774 --- pthreads-snap-2004-06-22/tests/mutex8e.c    2002-02-20 05:39:56.000000000 +0100
775 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/mutex8e.c   2009-01-06 17:17:19.000000000 +0100
776 @@ -57,7 +57,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/mutex8n.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/mutex8n.c
786 --- pthreads-snap-2004-06-22/tests/mutex8n.c    2002-02-20 05:39:56.000000000 +0100
787 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/mutex8n.c   2009-01-06 17:17:19.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/mutex8r.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/mutex8r.c
798 --- pthreads-snap-2004-06-22/tests/mutex8r.c    2002-02-20 05:39:56.000000000 +0100
799 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/mutex8r.c   2009-01-06 17:17:19.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/rwlock2_t.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/rwlock2_t.c
810 --- pthreads-snap-2004-06-22/tests/rwlock2_t.c  2003-08-19 05:31:51.000000000 +0200
811 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/rwlock2_t.c 2009-01-06 17:17:19.000000000 +0100
812 @@ -55,7 +55,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/rwlock3_t.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/rwlock3_t.c
822 --- pthreads-snap-2004-06-22/tests/rwlock3_t.c  2003-08-19 05:31:51.000000000 +0200
823 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/rwlock3_t.c 2009-01-06 17:17:19.000000000 +0100
824 @@ -68,7 +68,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/rwlock4_t.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/rwlock4_t.c
834 --- pthreads-snap-2004-06-22/tests/rwlock4_t.c  2003-08-19 05:31:51.000000000 +0200
835 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/rwlock4_t.c 2009-01-06 17:17:19.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/rwlock5_t.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/rwlock5_t.c
846 --- pthreads-snap-2004-06-22/tests/rwlock5_t.c  2003-08-19 05:31:51.000000000 +0200
847 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/rwlock5_t.c 2009-01-06 17:17:19.000000000 +0100
848 @@ -70,7 +70,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/rwlock6.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/rwlock6.c
858 --- pthreads-snap-2004-06-22/tests/rwlock6.c    2003-08-19 05:31:51.000000000 +0200
859 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/rwlock6.c   2009-01-06 17:17:19.000000000 +0100
860 @@ -77,9 +77,9 @@
861    pthread_t wrt1;
862    pthread_t wrt2;
863    pthread_t rdt;
864 -  int wr1Result = 0;
865 -  int wr2Result = 0;
866 -  int rdResult = 0;
867 +  DWORD_PTR wr1Result = 0;
868 +  DWORD_PTR wr2Result = 0;
869 +  DWORD_PTR rdResult = 0;
870  
871    bankAccount = 0;
872  
873 diff -Naur pthreads-snap-2004-06-22/tests/rwlock6_t2.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/rwlock6_t2.c
874 --- pthreads-snap-2004-06-22/tests/rwlock6_t2.c 2003-08-19 05:31:51.000000000 +0200
875 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/rwlock6_t2.c        2009-01-06 17:17:19.000000000 +0100
876 @@ -86,15 +86,15 @@
877    pthread_t wrt1;
878    pthread_t wrt2;
879    pthread_t rdt;
880 -  int wr1Result = 0;
881 -  int wr2Result = 0;
882 -  int rdResult = 0;
883 +  DWORD_PTR wr1Result = 0;
884 +  DWORD_PTR wr2Result = 0;
885 +  DWORD_PTR rdResult = 0;
886    struct _timeb currSysTime;
887    const DWORD NANOSEC_PER_MILLISEC = 1000000;
888  
889    _ftime(&currSysTime);
890  
891 -  abstime.tv_sec = currSysTime.time;
892 +  abstime.tv_sec = (long)currSysTime.time;
893    abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm;
894  
895    abstime.tv_sec += 1;
896 diff -Naur pthreads-snap-2004-06-22/tests/rwlock6_t.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/rwlock6_t.c
897 --- pthreads-snap-2004-06-22/tests/rwlock6_t.c  2003-08-19 05:31:51.000000000 +0200
898 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/rwlock6_t.c 2009-01-06 17:17:19.000000000 +0100
899 @@ -67,7 +67,7 @@
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  
908 @@ -95,10 +95,10 @@
909    pthread_t wrt2;
910    pthread_t rdt1;
911    pthread_t rdt2;
912 -  int wr1Result = 0;
913 -  int wr2Result = 0;
914 -  int rd1Result = 0;
915 -  int rd2Result = 0;
916 +  DWORD_PTR wr1Result = 0;
917 +  DWORD_PTR wr2Result = 0;
918 +  DWORD_PTR rd1Result = 0;
919 +  DWORD_PTR rd2Result = 0;
920  
921    bankAccount = 0;
922  
923 diff -Naur pthreads-snap-2004-06-22/tests/semaphore1.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/semaphore1.c
924 --- pthreads-snap-2004-06-22/tests/semaphore1.c 2003-08-19 05:31:51.000000000 +0200
925 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/semaphore1.c        2009-01-06 17:17:19.000000000 +0100
926 @@ -117,7 +117,7 @@
927  {
928    pthread_t t;
929    sem_t s;
930 -  int result;
931 +  DWORD_PTR result;
932  
933    assert(pthread_create(&t, NULL, thr, NULL) == 0);
934    assert(pthread_join(t, (void **)&result) == 0);
935 diff -Naur pthreads-snap-2004-06-22/tests/spin4.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/spin4.c
936 --- pthreads-snap-2004-06-22/tests/spin4.c      2003-08-19 05:31:51.000000000 +0200
937 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/spin4.c     2009-01-06 17:17:19.000000000 +0100
938 @@ -63,7 +63,7 @@
939  int
940  main()
941  {
942 -  long result = 0;
943 +  DWORD_PTR result = 0;
944    pthread_t t;
945    int CPUs;
946    struct _timeb sysTime;
947 diff -Naur pthreads-snap-2004-06-22/tests/tsd1.c pthreads-snap-2004-06-22_w64+bacula-patch/tests/tsd1.c
948 --- pthreads-snap-2004-06-22/tests/tsd1.c       2003-08-19 05:31:51.000000000 +0200
949 +++ pthreads-snap-2004-06-22_w64+bacula-patch/tests/tsd1.c      2009-01-06 17:17:19.000000000 +0100
950 @@ -171,7 +171,7 @@
951     */
952    for (i = 1; i < 10; i++)
953      {
954 -       int result = 0;
955 +       DWORD_PTR result = 0;
956  
957         assert(pthread_join(thread[i], (void **) &result) == 0);
958      }