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