]> git.sur5r.net Git - bacula/bacula/blob - bacula/patches/testing/build-w64.patch
ebl Change Win32 by Win64 in status
[bacula/bacula] / bacula / patches / testing / build-w64.patch
1 Index: src/win32/filed/vss.cpp
2 ===================================================================
3 --- src/win32/filed/vss.cpp     (revision 8361)
4 +++ src/win32/filed/vss.cpp     (working copy)
5 @@ -215,7 +215,7 @@
6  const int VSSClient::GetWriterState(int nIndex)
7  {
8     alist* pV = (alist*)m_pAlistWriterState;   
9 -   return (int)pV->get(nIndex);
10 +   return (int)(intptr_t)pV->get(nIndex);
11  }
12  
13  void VSSClient::AppendWriterInfo(int nState, const char* pszInfo)
14 Index: src/win32/filed/Makefile
15 ===================================================================
16 --- src/win32/filed/Makefile    (revision 8361)
17 +++ src/win32/filed/Makefile    (working copy)
18 @@ -62,7 +62,7 @@
19         $(LIBS_ZLIB) \
20         -lole32 \
21         -loleaut32 \
22 -       -lwsock32 \
23 +       -lws2_32 \
24         -luuid \
25         -lcomctl32
26  
27 Index: src/win32/build-depkgs-mingw-w64
28 ===================================================================
29 --- src/win32/build-depkgs-mingw-w64    (revision 8361)
30 +++ src/win32/build-depkgs-mingw-w64    (working copy)
31 @@ -246,7 +246,14 @@
32     perl util/mkdef.pl 32 libeay no-static-engine >ms/libeay32.def
33     perl util/mkdef.pl 32 ssleay >ms/ssleay32.def
34     perl util/mkdef.pl crypto ssl NT update
35 -   CFLAG=-I${DEPPKG_DIR}/include do_make Makefile all
36 +   CFLAGS=-I${DEPPKG_DIR}/include do_make Makefile all
37 +   cd engines
38 +   touch lib4758cca.bad libaep.bad libatalla.bad libcswift.bad libchil.bad libgmp.bad libnuron.bad libsureware.bad libubsec.bad libcapi.bad
39 +   cd ..
40 +   sed -i 's/ cc/ mingw32-gcc/' crypto/comp/Makefile
41 +   sed -i 's/ ar/ mingw32-ar/'  crypto/comp/Makefile
42 +   sed -i 's:^CFLAGS=:CFLAGS= -I${DEPPKG_DIR}/include:' crypto/comp/Makefile
43 +   CFLAGS=-I${DEPPKG_DIR}/include do_make Makefile all
44     echo Installing openssl
45     do_make Makefile install_sw
46  }
47 Index: src/win32/Makefile
48 ===================================================================
49 --- src/win32/Makefile  (revision 8361)
50 +++ src/win32/Makefile  (working copy)
51 @@ -1,4 +1,4 @@
52 -ECHO_CMD=@
53 +ECHO_CMD=
54  
55  DIRS=  dll \
56         cats \
57 Index: src/win32/compat/winhost.h
58 ===================================================================
59 --- src/win32/compat/winhost.h  (revision 8361)
60 +++ src/win32/compat/winhost.h  (working copy)
61 @@ -41,7 +41,11 @@
62  
63  #define HOST_OS  "Linux"
64  #define DISTNAME "Cross-compile"
65 +#ifdef MINGW64
66 +#define DISTVER "Win64"
67 +#else
68  #define DISTVER  "Win32"
69 +#endif
70  
71  #else
72  
73 Index: src/win32/compat/compat.cpp
74 ===================================================================
75 --- src/win32/compat/compat.cpp (revision 8361)
76 +++ src/win32/compat/compat.cpp (working copy)
77 @@ -733,7 +733,7 @@
78  }
79  
80  int
81 -fstat(int fd, struct stat *sb)
82 +fstat(intptr_t fd, struct stat *sb)
83  {
84     BY_HANDLE_FILE_INFORMATION info;
85  
86 @@ -827,7 +827,7 @@
87        return -1;
88     }
89  
90 -   rval = fstat((int)h, sb);
91 +   rval = fstat((intptr_t)h, sb);
92     CloseHandle(h);
93  
94     if (attr & FILE_ATTRIBUTE_DIRECTORY &&
95 @@ -2201,7 +2201,7 @@
96                                       // process terminates we can
97                                       // detect eof.
98          // ugly but convert WIN32 HANDLE to FILE*
99 -        int rfd = _open_osfhandle((long)hChildStdoutRdDup, O_RDONLY | O_BINARY);
100 +        int rfd = _open_osfhandle((intptr_t)hChildStdoutRdDup, O_RDONLY | O_BINARY);
101          if (rfd >= 0) {
102             bpipe->rfd = _fdopen(rfd, "rb");
103          }
104 @@ -2210,7 +2210,7 @@
105          CloseHandle(hChildStdinRd); // close our read side so as not
106                                      // to interfre with child's copy
107          // ugly but convert WIN32 HANDLE to FILE*
108 -        int wfd = _open_osfhandle((long)hChildStdinWrDup, O_WRONLY | O_BINARY);
109 +        int wfd = _open_osfhandle((intptr_t)hChildStdinWrDup, O_WRONLY | O_BINARY);
110          if (wfd >= 0) {
111             bpipe->wfd = _fdopen(wfd, "wb");
112          }
113 @@ -2316,6 +2316,7 @@
114      return result;
115  }
116  
117 +#ifndef MINGW64
118  int
119  utime(const char *fname, struct utimbuf *times)
120  {
121 @@ -2367,6 +2368,7 @@
122      }
123      return rval;
124  }
125 +#endif
126  
127  #if 0
128  int
129 Index: src/win32/compat/compat.h
130 ===================================================================
131 --- src/win32/compat/compat.h   (revision 8361)
132 +++ src/win32/compat/compat.h   (working copy)
133 @@ -57,6 +57,15 @@
134  
135  #include <malloc.h>
136  
137 +#ifdef MINGW64
138 +#include <direct.h>
139 +#define _declspec __declspec
140 +#endif
141 +
142 +#ifdef _WIN64
143 +# define GWL_USERDATA  GWLP_USERDATA
144 +#endif
145 +
146  typedef UINT64 u_int64_t;
147  typedef UINT64 uint64_t;
148  typedef INT64 int64_t;
149 @@ -74,8 +83,11 @@
150  #endif
151  
152  #if !defined(_MSC_VER) || (_MSC_VER < 1400) // VC8+
153 -typedef long time_t;
154 +#ifndef _TIME_T_DEFINED
155 +#define _TIME_T_DEFINED
156 + typedef long time_t;
157  #endif
158 +#endif
159  
160  #if __STDC__ && !defined(HAVE_MINGW)
161  typedef _dev_t dev_t;
162 @@ -129,10 +141,15 @@
163  #endif
164  #endif
165  
166 +#ifndef _TIMEZONE_DEFINED /* also in sys/time.h */
167 +#define _TIMEZONE_DEFINED
168 +
169  struct timezone {
170      int foo;
171  };
172  
173 +#endif
174 +
175  int strcasecmp(const char*, const char *);
176  int gettimeofday(struct timeval *, struct timezone *);
177  
178 @@ -244,10 +261,12 @@
179  ssize_t win32_write(int fd, const void *buffer, size_t count);
180  int win32_ioctl(int fd, unsigned long int req, ...);
181  
182 -#define open   _open
183 +#if !defined(MINGW64)
184 +# define open   _open
185 +#endif
186  
187  int fcntl(int fd, int cmd, long arg);
188 -int fstat(int fd, struct stat *sb);
189 +int fstat(intptr_t fd, struct stat *sb);
190  
191  int inet_aton(const char *cp, struct in_addr *inp);
192  int kill(int pid, int signo);
193 @@ -263,7 +282,6 @@
194  #define snprintf _snprintf
195  #endif //HAVE_MINGW
196  
197 -
198  #define WNOHANG 0
199  #define WIFEXITED(x) 0
200  #define WEXITSTATUS(x) x
201 Index: src/win32/compat/print.cpp
202 ===================================================================
203 --- src/win32/compat/print.cpp  (revision 8361)
204 +++ src/win32/compat/print.cpp  (working copy)
205 @@ -340,7 +340,7 @@
206              case 'p':
207                  strvalue = (char *) va_arg(args, void *);
208                  flags |= DP_F_UNSIGNED;
209 -                fmtint(buffer, &currlen, maxlen, (long) strvalue, 16, min, max,
210 +                fmtint(buffer, &currlen, maxlen, (INT64) strvalue, 16, min, max,
211                         flags, outch);
212                  break;
213              case 'n':
214 Index: src/win32/libwin32/statusDialog.cpp
215 ===================================================================
216 --- src/win32/libwin32/statusDialog.cpp (revision 8361)
217 +++ src/win32/libwin32/statusDialog.cpp (working copy)
218 @@ -110,7 +110,7 @@
219           
220           if (*p == '\n') {
221              SendMessage(statDlg->m_textWin, EM_SETSEL, (WPARAM)-1, (LPARAM)-1);
222 -            SendMessage(statDlg->m_textWin, EM_REPLACESEL, 0, (LONG)"\r\n");
223 +            SendMessage(statDlg->m_textWin, EM_REPLACESEL, 0, (LPARAM)"\r\n");
224           }
225  
226           if (*p == '\0'){
227 @@ -149,7 +149,7 @@
228  {
229     if (show && !m_visible) {
230        DialogBoxParam(appInstance, MAKEINTRESOURCE(IDD_STATUS), NULL,
231 -          (DLGPROC)dialogProc, (LONG)this);
232 +          (DLGPROC)dialogProc, (LPARAM)this);
233     }
234  }
235  
236 Index: src/win32/libwin32/bacula.rc
237 ===================================================================
238 --- src/win32/libwin32/bacula.rc        (revision 8361)
239 +++ src/win32/libwin32/bacula.rc        (working copy)
240 @@ -104,15 +104,14 @@
241   * About Dialog
242   */
243  IDD_ABOUT DIALOG  0, 0, 250, 145
244 -STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
245  CAPTION "About Bacula"
246  FONT 8, "MS Sans Serif"
247  BEGIN
248 -    DEFPUSHBUTTON   "OK",IDOK,190,120,50,15
249 +//    DEFPUSHBUTTON   "OK",IDOK,190,120,50,15
250  //  CONTROL         "\3", IDC_BACULABMP,"Static",SS_ICON | SS_CENTERIMAGE |
251  //                  SS_SUNKEN,7,5,73,65
252  #ifndef HAVE_MINGW
253 -    CONTROL         IDB_BACULABMP,IDB_BACULABMP,"Static",SS_BITMAP|SS_SUNKEN,7,5,32,32
254 +//    CONTROL         IDB_BACULABMP,IDB_BACULABMP,"Static",SS_BITMAP|SS_SUNKEN,7,5,32,32
255  #endif
256  
257      LTEXT           "      by Kern Sibbald",-1,134,38,78,10
258 @@ -132,10 +131,10 @@
259   * Status Dialog
260   */
261  IDD_STATUS DIALOGEX 0, 0, 411, 244
262 -STYLE DS_SETFONT | DS_3DLOOK | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
263 +//STYLE DS_SETFONT | DS_3DLOOK | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
264  CAPTION "Bacula Status"
265  FONT 8, "Courier New"
266  BEGIN
267 -    DEFPUSHBUTTON   "&OK",IDOK,355,5,51,15
268 -    EDITTEXT        IDC_TEXTDISPLAY, 2, 2, 350, 240, WS_VSCROLL | WS_HSCROLL | WS_BORDER | ES_READONLY | ES_MULTILINE
269 +//    DEFPUSHBUTTON   "&OK",IDOK,355,5,51,15
270 +//    EDITTEXT        IDC_TEXTDISPLAY, 2, 2, 350, 240, WS_VSCROLL | WS_HSCROLL | WS_BORDER | ES_READONLY | ES_MULTILINE
271  END
272 Index: src/win32/libwin32/main.cpp
273 ===================================================================
274 --- src/win32/libwin32/main.cpp (revision 8361)
275 +++ src/win32/libwin32/main.cpp (working copy)
276 @@ -53,7 +53,7 @@
277  #include <pthread.h>
278  
279  #undef  _WIN32_IE
280 -#define _WIN32_IE 0x0401
281 +#define _WIN32_IE 0x0501
282  #undef  _WIN32_WINNT
283  #define _WIN32_WINNT 0x0501
284  #include <commctrl.h>
285 Index: src/win32/libwin32/trayMonitor.cpp
286 ===================================================================
287 --- src/win32/libwin32/trayMonitor.cpp  (revision 8361)
288 +++ src/win32/libwin32/trayMonitor.cpp  (working copy)
289 @@ -73,7 +73,7 @@
290     }
291  
292     /* Save our class pointer */
293 -   SetWindowLong(m_hwnd, GWL_USERDATA, (LONG)this);
294 +   SetWindowLong(m_hwnd, GWL_USERDATA, (LPARAM)this);
295  
296  
297     // Load the icons for the tray
298 Index: src/win32/libwin32/aboutDialog.cpp
299 ===================================================================
300 --- src/win32/libwin32/aboutDialog.cpp  (revision 8361)
301 +++ src/win32/libwin32/aboutDialog.cpp  (working copy)
302 @@ -76,6 +76,6 @@
303  {
304     if (show && !m_visible) {
305        DialogBoxParam(appInstance, MAKEINTRESOURCE(IDD_ABOUT), NULL,
306 -         (DLGPROC)DialogProc, (LONG)this);
307 +         (DLGPROC)DialogProc, (LPARAM)this);
308     }
309  }
310 Index: src/win32/Makefile.inc.in
311 ===================================================================
312 --- src/win32/Makefile.inc.in   (revision 8361)
313 +++ src/win32/Makefile.inc.in   (working copy)
314 @@ -9,7 +9,7 @@
315  
316  # Global Configuration
317  
318 -ECHO_CMD = @
319 +ECHO_CMD =
320  
321  # Main Bacula source dir
322  MAINDIR := @WIN32MAINDIR@
323 @@ -37,12 +37,12 @@
324  AR := $(MINGW_BIN)/mingw32-ar
325  RANLIB := $(MINGW_BIN)/mingw32-ranlib
326  WINDRES := $(MINGW_BIN)/mingw32-windres
327 -DLLTOOL := $(MINGW_BIN)/../mingw32/bin/dlltool
328 +DLLTOOL := $(MINGW_BIN)/mingw32-dlltool
329  OBJCPY := $(MINGW_BIN)/mingw32-objcopy
330  NSIS_DIR := $(DEPKGS)/nsis
331  STAB2CV := $(DEPKGS)/tools/bin/stab2cv
332  
333 -CFLAGS := -g -Wall -mno-cygwin -m32 -mwin32 -mthreads -O3 -fno-strict-aliasing
334 +CFLAGS := -g -Wall -mno-cygwin -mthreads -O3 -fno-strict-aliasing -DHAVE_VSS64
335  LDFLAGS := -g -Wall -mno-cygwin -Wl,--disable-auto-import
336  
337  INCLUDE_DDK := -I$(MINGW_INCLUDE)/ddk
338 Index: src/win32/dll/bacula.def
339 ===================================================================
340 --- src/win32/dll/bacula.def    (revision 8361)
341 +++ src/win32/dll/bacula.def    (working copy)
342 @@ -23,8 +23,8 @@
343  _Z17SetVSSPathConvertPFiPKcPciEPFiPKwPwiE
344  _Z18CreateChildProcessPKcPvS1_S1_
345  _Z18GetApplicationNamePKcPPcPS0_
346 +_Z18cvt_utime_to_ftimeRKxR9_FILETIME
347  _Z18cvt_ftime_to_utimeRK9_FILETIME
348 -_Z18cvt_utime_to_ftimeRKlR9_FILETIME
349  _Z18unix_name_to_win32PPcS_
350  _Z21Win32ConvCleanupCachev
351  _Z21make_wchar_win32_pathPcPi
352 @@ -37,7 +37,7 @@
353  _Z5chownPKcjj
354  _Z5fcntlii
355  _Z5fcntliil
356 -_Z5fstatiP4stat
357 +_Z5fstatxP4stat
358  _Z5lstatPKcP4stat
359  _Z5sleepi
360  _Z6execvpPKcPPc
361 @@ -73,11 +73,11 @@
362  _Z19dbg_plugin_add_hookPFvP6PluginP6_iobufE
363  
364  ; print.o
365 -_Z10__snprintfPcjPKcz
366  _Z10__vsprintfPcPKcS_
367 -_Z11__vsnprintfPcjPKcS_
368 -_Z4doprPcjPKcS_PFvS_PjjiE
369 +_Z11__vsnprintfPcyPKcS_
370 +_Z10__snprintfPcyPKcz
371  _Z9__sprintfPcPKcz
372 +_Z4doprPcyPKcS_PFvS_PyyiE
373   
374  ; winapi.o
375  _Z17InitWinAPIWrapperv
376 @@ -89,12 +89,6 @@
377  _Z14set_attributesP3JCRP4ATTRP5BFILE
378  _Z16encode_attribsExP3JCRPcP6FF_PKT
379  _Z18select_data_streamP6FF_PKT
380 -_Z4plugIjEvRT_y
381 -_Z4plugIlEvRT_y
382 -_Z4plugImEvRT_y
383 -_Z4plugIsEvRT_y
384 -_Z4plugItEvRT_y
385 -_Z4plugIyEvRT_y
386  _Z9win_errorP3JCRPcS1_
387  _Z9win_errorP3JCRPcm
388   
389 @@ -109,15 +103,15 @@
390  _Z18is_portable_backupP5BFILE
391  _Z19set_portable_backupP5BFILE
392  _Z14set_cmd_pluginP5BFILEP3JCR
393 -_Z26processWin32BackupAPIBlockP5BFILEPvl
394 +_Z26processWin32BackupAPIBlockP5BFILEPvx
395  _Z27is_restore_stream_supportedi
396  _Z5binitP5BFILE
397  _Z5bopenP5BFILEPKcit
398 -_Z5breadP5BFILEPvj
399 +_Z5breadP5BFILEPvy
400  _Z6bcloseP5BFILE
401  _Z6blseekP5BFILExi
402 -_Z6bwriteP5BFILEPvj
403  _Z8is_bopenP5BFILE
404 +_Z6bwriteP5BFILEPvy
405   
406  ; create_file.o
407  _Z11create_fileP3JCRP4ATTRP5BFILEi
408 @@ -133,7 +127,7 @@
409  _Z13is_in_filesetP6FF_PKT
410  _Z15init_find_filesv
411  _Z15term_find_filesP6FF_PKT
412 -_Z16set_find_optionsP6FF_PKTil
413 +_Z16set_find_optionsP6FF_PKTix
414  _Z22get_win32_drivelettersP6FF_PKTPc
415  _Z25set_find_changed_functionP6FF_PKTPFbP3JCRS0_E
416   
417 @@ -269,7 +263,7 @@
418  _ZN7BREGEXP7replaceEPKc
419   
420  ; bregex.o
421 -_Z24re_registers_to_regmatchP12re_registersP12b_regmatch_tj
422 +_Z24re_registers_to_regmatchP12re_registersP12b_regmatch_ty
423  b_re_compile_fastmap
424  b_re_compile_initialize
425  b_re_compile_pattern
426 @@ -298,12 +292,12 @@
427  _ZN5BSOCK4initEv
428  _ZN5BSOCK4recvEv
429  _ZN5BSOCK4sendEv
430 -_ZN5BSOCK5_openEP3JCRPKcPcS4_ixPi
431 +_ZN5BSOCK4openEP3JCRPKcPcS4_ixPi
432 +_ZN5BSOCK7despoolEPFvxEx
433  _ZN5BSOCK5closeEv
434  _ZN5BSOCK5fsendEPKcz
435  _ZN5BSOCK6signalEi
436  _ZN5BSOCK7connectEP3JCRixxPKcPcS4_ii
437 -_ZN5BSOCK7despoolEPFvlEl
438  _ZN5BSOCK7destroyEv
439  _ZN5BSOCK8fin_initEP3JCRiPKcS3_iP8sockaddr
440  _ZN5BSOCK8get_peerEPci
441 @@ -311,7 +305,7 @@
442  _ZN5BSOCK9wait_dataEii
443   
444  ; bsys.o
445 -_Z10b_strerroriPcj
446 +_Z10b_strerroriPcy
447  _Z11bmicrosleepii
448  _Z15create_pid_filePcPKci
449  _Z15delete_pid_filePcPKci
450 @@ -322,11 +316,11 @@
451  _Z4dropPcS_
452  _Z5bfreePv
453  _Z6bfgetsPciP6_iobuf
454 -_Z7bcallocjj
455 +_Z7bcallocyy
456  _Z7bstrcmpPKcS0_
457  _Z7cstrlenPKc
458 -_Z8b_mallocPKcij
459 -_Z8breallocPvj
460 +_Z8b_mallocPKciy
461 +_Z8breallocPvy
462  _Z8bstrncatPcPKci
463  _Z8bstrncatPcR8POOL_MEMi
464  _Z8bstrncpyPcPKci
465 @@ -349,7 +343,6 @@
466  _Z17date_time_compareP9date_timeS0_
467  _Z17get_current_btimev
468  _Z6tm_womii
469 -_Z6tm_woyl
470  _Z9bstrftimePcix
471  _Z9bstrutimePcix
472  _Z9tm_decodeP9date_timeP2tm
473 @@ -359,7 +352,7 @@
474  _Z16stop_bsock_timerP8btimer_t
475  _Z16stop_child_timerP8btimer_t
476  _Z17start_bsock_timerP5BSOCKj
477 -_Z17start_child_timerP3JCRij
478 +_Z17start_child_timerP3JCRxj
479  _Z17stop_thread_timerP8btimer_t
480  _Z18start_thread_timerP3JCRP10pthread_t_j
481  
482 Index: src/win32/dll/Makefile
483 ===================================================================
484 --- src/win32/dll/Makefile      (revision 8361)
485 +++ src/win32/dll/Makefile      (working copy)
486 @@ -109,7 +109,7 @@
487         $(LIBS_CRYPTO) \
488         $(LIBS_PTHREADS) \
489         $(LIBS_ZLIB) \
490 -       -lwsock32 \
491 +       -lws2_32 \
492         -lole32 \
493         -loleaut32 \
494         -luuid
495 Index: src/lib/message.c
496 ===================================================================
497 --- src/lib/message.c   (revision 8361)
498 +++ src/lib/message.c   (working copy)
499 @@ -370,10 +370,10 @@
500  {
501     if (jcr) {
502        Mmsg(name, "%s/%s.%s.%d.mail", working_directory, my_name,
503 -                 jcr->Job, (int)(long)d);
504 +                 jcr->Job, (int)(intptr_t)d);
505     } else {
506        Mmsg(name, "%s/%s.%s.%d.mail", working_directory, my_name,
507 -                 my_name, (int)(long)d);
508 +                 my_name, (int)(intptr_t)d);
509     }
510     Dmsg1(850, "mailname=%s\n", name);
511  }
512 Index: src/lib/smartall.c
513 ===================================================================
514 --- src/lib/smartall.c  (revision 8361)
515 +++ src/lib/smartall.c  (working copy)
516 @@ -134,7 +134,7 @@
517        head->ablineno = (sm_ushort)lineno;
518        head->abin_use = true;
519        /* Emplace end-clobber detector at end of buffer */
520 -      buf[nbytes - 1] = (uint8_t)((((long) buf) & 0xFF) ^ 0xC5);
521 +      buf[nbytes - 1] = (uint8_t)((((intptr_t) buf) & 0xFF) ^ 0xC5);
522        buf += HEAD_SIZE;  /* Increment to user data start */
523        if (++sm_buffers > sm_max_buffers) {
524           sm_max_buffers = sm_buffers;
525 @@ -212,7 +212,7 @@
526        allocated  space in the buffer by comparing the end of buffer
527        checksum with the address of the buffer.  */
528  
529 -   if (((unsigned char *)cp)[head->ablen - 1] != ((((long) cp) & 0xFF) ^ 0xC5)) {
530 +   if (((unsigned char *)cp)[head->ablen - 1] != ((((intptr_t) cp) & 0xFF) ^ 0xC5)) {
531        V(mutex);
532        Emsg2(M_ABORT, 0, _("Buffer overrun called from %s:%d\n"), file, line);
533     }
534 @@ -463,7 +463,7 @@
535              bad |= 0x2;
536           }
537           if (((unsigned char *) ap)[((struct abufhead *)ap)->ablen - 1] !=
538 -              ((((long) ap) & 0xFF) ^ 0xC5)) {
539 +              ((((intptr_t) ap) & 0xFF) ^ 0xC5)) {
540              bad |= 0x4;
541           }
542        } else {