[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bacula-devel] patch: win32 and bat fixes



Hi,
this patch fixes some win32 compilation errors and a bug with bat version browser.

Ciao,
Riccardo

Index: src/dird/inc_conf.c
===================================================================
--- src/dird/inc_conf.c	(revision 8036)
+++ src/dird/inc_conf.c	(working copy)
@@ -75,7 +75,7 @@
 #else
 extern URES res_all;
 #endif
-extern int  res_all_size;
+extern int32_t  res_all_size;
 
 /* We build the current new Include and Exclude items here */
 static INCEXE res_incexe;
Index: src/qt-console/pages.cpp
===================================================================
--- src/qt-console/pages.cpp	(revision 8036)
+++ src/qt-console/pages.cpp	(working copy)
@@ -37,10 +37,11 @@
 /* A global function */
 bool isWin32Path(QString &fullPath) 
 {
-   char *buf = fullPath.left(2).toUtf8().data();
+   if (fullPath.size()<2) {
+      return false;
+   }
 
-   //bool toret = B_ISALPHA(buf[1]);
-   bool toret = buf[1] == ':' && B_ISALPHA(buf[0]);
+   bool toret = fullPath[1].toAscii() == ':' && fullPath[0].isLetter();
    if (mainWin->m_miscDebug) {
       if (toret)
          Pmsg1(000, "returning from isWin32Path true %s\n", fullPath.toUtf8().data());
Index: src/qt-console/bat_conf.cpp
===================================================================
--- src/qt-console/bat_conf.cpp	(revision 8036)
+++ src/qt-console/bat_conf.cpp	(working copy)
@@ -69,11 +69,10 @@
  * then move it to allocated memory when the resource
  * scan is complete.
  */
-#if defined(MSC_VER)
-extern "C" URES res_all; /* visual c mangles variable names */
-#else
-URES res_all;
+#if defined(_MSC_VER)
+extern "C" URES res_all; /* declare as C to avoid name mangling by visual c */
 #endif
+URES res_all;
 int32_t res_all_size = sizeof(res_all);
 
 /* Definition of records permitted within each
Index: src/qt-console/bat.h
===================================================================
--- src/qt-console/bat.h	(revision 8036)
+++ src/qt-console/bat.h	(working copy)
@@ -53,7 +53,6 @@
 extern MainWin *mainWin;
 extern QApplication *app;
 
-int bvsnprintf(char *str, int32_t size, const char *format, va_list ap);
 bool isWin32Path(QString &fullPath);
 
 #endif /* _BAT_H_ */
Index: src/win32/cats/bacula_cats.def
===================================================================
--- src/win32/cats/bacula_cats.def	(revision 8036)
+++ src/win32/cats/bacula_cats.def	(working copy)
@@ -6,6 +6,7 @@
 _Z11db_strerrorP4B_DB
 _Z11list_dashesP4B_DBPFvPvPKcES1_
 _Z11list_resultP3JCRP4B_DBPFvPvPKcES3_11e_list_type
+_Z13_dbg_print_dbP3JCRP6_iobuf
 _Z16db_int64_handlerPviPPc
 _Z18db_end_transactionP3JCRP4B_DB
 _Z18get_sql_record_maxP3JCRP4B_DB
Index: src/win32/compat/compat.cpp
===================================================================
--- src/win32/compat/compat.cpp	(revision 8036)
+++ src/win32/compat/compat.cpp	(working copy)
@@ -40,6 +40,7 @@
 #include "bacula.h"
 #include "compat.h"
 #include "jcr.h"
+#include "findlib/find.h"
 
 #define b_errno_win32 (1<<29)
 
@@ -2293,8 +2294,6 @@
     return result;
 }
 
-#include "findlib/find.h"
-
 int
 utime(const char *fname, struct utimbuf *times)
 {
Index: src/win32/compat/winconfig.h
===================================================================
--- src/win32/compat/winconfig.h	(revision 8036)
+++ src/win32/compat/winconfig.h	(working copy)
@@ -410,7 +410,7 @@
 #define HAVE_STDLIB_H 1
 
 /* Define to 1 if you have the `strcasecmp' function. */
-#define HAVE_STRCASECMP 1
+/*#define HAVE_STRCASECMP 1*/
 
 /* Define to 1 if you have the `strerror' function. */
 #define HAVE_STRERROR 1
Index: src/findlib/find.h
===================================================================
--- src/findlib/find.h	(revision 8036)
+++ src/findlib/find.h	(working copy)
@@ -44,7 +44,9 @@
 #endif
 
 #include <sys/file.h>
+#if !defined(HAVE_WIN32) || defined(HAVE_MINGW)
 #include <sys/param.h>
+#endif
 #if HAVE_UTIME_H
 #include <utime.h>
 #else
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Bacula-devel mailing list
Bacula-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/bacula-devel


This mailing list archive is a service of Copilot Consulting.