From fa584d1f79379932d800fdb2de3568702d38ba4e Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Wed, 12 Nov 2008 09:58:33 +0000 Subject: [PATCH] ebl Apply Riccardo's patch that fix some win32 compilation errors and a bug with bat version browser. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8037 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/dird/inc_conf.c | 2 +- bacula/src/findlib/find.h | 2 ++ bacula/src/jcr.h | 2 +- bacula/src/qt-console/bat.h | 1 - bacula/src/qt-console/bat_conf.cpp | 7 +++---- bacula/src/qt-console/pages.cpp | 7 ++++--- bacula/src/win32/cats/bacula_cats.def | 1 + bacula/src/win32/compat/compat.cpp | 3 +-- bacula/src/win32/compat/winconfig.h | 2 +- bacula/src/win32/dll/bacula.def | 2 ++ bacula/technotes-2.5 | 3 +++ 11 files changed, 19 insertions(+), 13 deletions(-) diff --git a/bacula/src/dird/inc_conf.c b/bacula/src/dird/inc_conf.c index 7fa7399357..c8a7dfa2a4 100644 --- a/bacula/src/dird/inc_conf.c +++ b/bacula/src/dird/inc_conf.c @@ -75,7 +75,7 @@ extern "C" { // work around visual compiler mangling variables #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; diff --git a/bacula/src/findlib/find.h b/bacula/src/findlib/find.h index 895ecbf46b..86568bda08 100644 --- a/bacula/src/findlib/find.h +++ b/bacula/src/findlib/find.h @@ -44,7 +44,9 @@ #endif #include +#if !defined(HAVE_WIN32) || defined(HAVE_MINGW) #include +#endif #if HAVE_UTIME_H #include #else diff --git a/bacula/src/jcr.h b/bacula/src/jcr.h index 1339948812..a07b6dc429 100644 --- a/bacula/src/jcr.h +++ b/bacula/src/jcr.h @@ -468,6 +468,6 @@ extern void free_jcr(JCR *jcr); /* Used to display specific job information after a fatal signal */ typedef void (dbg_jcr_hook_t)(JCR *jcr, FILE *fp); -void dbg_jcr_add_hook(dbg_jcr_hook_t *fct); +extern void dbg_jcr_add_hook(dbg_jcr_hook_t *fct); #endif /* __JCR_H_ */ diff --git a/bacula/src/qt-console/bat.h b/bacula/src/qt-console/bat.h index afa423c75b..3a8182be21 100644 --- a/bacula/src/qt-console/bat.h +++ b/bacula/src/qt-console/bat.h @@ -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_ */ diff --git a/bacula/src/qt-console/bat_conf.cpp b/bacula/src/qt-console/bat_conf.cpp index 407b1fee83..13a4725049 100644 --- a/bacula/src/qt-console/bat_conf.cpp +++ b/bacula/src/qt-console/bat_conf.cpp @@ -69,11 +69,10 @@ RES **res_head = sres_head; * 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 diff --git a/bacula/src/qt-console/pages.cpp b/bacula/src/qt-console/pages.cpp index 7325e5092d..4dbe17f121 100644 --- a/bacula/src/qt-console/pages.cpp +++ b/bacula/src/qt-console/pages.cpp @@ -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()); diff --git a/bacula/src/win32/cats/bacula_cats.def b/bacula/src/win32/cats/bacula_cats.def index d4e891750e..3111e529d2 100644 --- a/bacula/src/win32/cats/bacula_cats.def +++ b/bacula/src/win32/cats/bacula_cats.def @@ -23,6 +23,7 @@ _ZN9dbid_listC1Ev _ZN9dbid_listC2Ev _ZN9dbid_listD1Ev _ZN9dbid_listD2Ev +_Z13_dbg_print_dbP3JCRP6_iobuf ; sql_create.o _Z20db_create_job_recordP3JCRP4B_DBP7JOB_DBR diff --git a/bacula/src/win32/compat/compat.cpp b/bacula/src/win32/compat/compat.cpp index e99c212f44..a6491a81d8 100644 --- a/bacula/src/win32/compat/compat.cpp +++ b/bacula/src/win32/compat/compat.cpp @@ -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 @@ close_wpipe(BPIPE *bpipe) return result; } -#include "findlib/find.h" - int utime(const char *fname, struct utimbuf *times) { diff --git a/bacula/src/win32/compat/winconfig.h b/bacula/src/win32/compat/winconfig.h index 98cd69bb40..fa1e0c37c7 100644 --- a/bacula/src/win32/compat/winconfig.h +++ b/bacula/src/win32/compat/winconfig.h @@ -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 diff --git a/bacula/src/win32/dll/bacula.def b/bacula/src/win32/dll/bacula.def index 5b0b89cfcd..3243d65182 100644 --- a/bacula/src/win32/dll/bacula.def +++ b/bacula/src/win32/dll/bacula.def @@ -70,6 +70,7 @@ utime _Z10new_pluginv _Z12load_pluginsPvS_PKcS1_ _Z14unload_pluginsv +_Z19dbg_plugin_add_hookPFvP6PluginP6_iobufE ; print.o _Z10__snprintfPcjPKcz @@ -517,6 +518,7 @@ _ZN3JCR12set_JobLevelEi _ZN3JCR14get_ActionNameEb _ZN3JCR17get_OperationNameEv _ZN3JCR8JobReadsEv +_Z16dbg_jcr_add_hookPFvP3JCRP6_iobufE timeout_handler diff --git a/bacula/technotes-2.5 b/bacula/technotes-2.5 index 78777a790a..f2f5760b34 100644 --- a/bacula/technotes-2.5 +++ b/bacula/technotes-2.5 @@ -10,6 +10,9 @@ filepattern (restore with regex in bsr) mixed priorities General: +12Nov08 +ebl Apply Riccardo's patch that fix some win32 compilation errors + and a bug with bat version browser. 11Nov08 ebl Add Plugin debug after a fatal signal. ebl Add db and rwlock debug after a fatal signal. -- 2.39.5