From f4a7252c8b33a15a6142d962384ef884e936d150 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 7 Nov 2008 20:39:30 +0000 Subject: [PATCH] Apply Riccardo's second patch that cleans up the #include file order + a few Win32 particularities to make bat work on Win32. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8017 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/qt-console/bat.h | 10 ++++++++-- bacula/src/qt-console/bat_conf.cpp | 4 ++++ bacula/src/qt-console/clients/clients.cpp | 2 +- bacula/src/qt-console/fileset/fileset.cpp | 2 +- bacula/src/qt-console/jobgraphs/jobplot.cpp | 2 +- bacula/src/qt-console/joblist/joblist.cpp | 2 +- bacula/src/qt-console/main.cpp | 2 +- bacula/src/qt-console/mediaedit/mediaedit.cpp | 3 +-- bacula/src/qt-console/medialist/medialist.cpp | 2 +- bacula/src/qt-console/pages.cpp | 2 +- bacula/src/qt-console/status/clientstat.cpp | 2 +- bacula/src/qt-console/status/dirstat.cpp | 2 +- bacula/src/qt-console/status/storstat.cpp | 2 +- bacula/src/qt-console/storage/storage.cpp | 2 +- bacula/src/qt-console/util/comboutil.cpp | 2 +- bacula/src/qt-console/util/fmtwidgetitem.cpp | 2 +- bacula/technotes-2.5 | 3 +++ 17 files changed, 29 insertions(+), 17 deletions(-) diff --git a/bacula/src/qt-console/bat.h b/bacula/src/qt-console/bat.h index 757237f82b..afa423c75b 100644 --- a/bacula/src/qt-console/bat.h +++ b/bacula/src/qt-console/bat.h @@ -34,11 +34,17 @@ * Kern Sibbald, January 2007 */ -#include "config.h" +#if defined(HAVE_WIN32) +#if !defined(_STAT_H) +#define _STAT_H /* don't pull in MinGW stat.h */ +#define _STAT_DEFINED /* don't pull in MinGW stat.h */ +#endif +#endif + #include #include -#include "mainwin.h" #include "bacula.h" +#include "mainwin.h" #include "bat_conf.h" #include "jcr.h" #include "console.h" diff --git a/bacula/src/qt-console/bat_conf.cpp b/bacula/src/qt-console/bat_conf.cpp index 30dd4f18c4..407b1fee83 100644 --- a/bacula/src/qt-console/bat_conf.cpp +++ b/bacula/src/qt-console/bat_conf.cpp @@ -69,7 +69,11 @@ 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; +#endif int32_t res_all_size = sizeof(res_all); /* Definition of records permitted within each diff --git a/bacula/src/qt-console/clients/clients.cpp b/bacula/src/qt-console/clients/clients.cpp index a458c414c7..20eabe1260 100644 --- a/bacula/src/qt-console/clients/clients.cpp +++ b/bacula/src/qt-console/clients/clients.cpp @@ -35,9 +35,9 @@ * */ +#include "bat.h" #include #include -#include "bat.h" #include "clients/clients.h" #include "run/run.h" #include "status/clientstat.h" diff --git a/bacula/src/qt-console/fileset/fileset.cpp b/bacula/src/qt-console/fileset/fileset.cpp index 20e8192605..60d878f160 100644 --- a/bacula/src/qt-console/fileset/fileset.cpp +++ b/bacula/src/qt-console/fileset/fileset.cpp @@ -35,9 +35,9 @@ * */ +#include "bat.h" #include #include -#include "bat.h" #include "fileset/fileset.h" #include "util/fmtwidgetitem.h" diff --git a/bacula/src/qt-console/jobgraphs/jobplot.cpp b/bacula/src/qt-console/jobgraphs/jobplot.cpp index 866975de7e..10c6a07f06 100644 --- a/bacula/src/qt-console/jobgraphs/jobplot.cpp +++ b/bacula/src/qt-console/jobgraphs/jobplot.cpp @@ -35,8 +35,8 @@ * */ -#include #include "bat.h" +#include #include "util/comboutil.h" #include "jobgraphs/jobplot.h" diff --git a/bacula/src/qt-console/joblist/joblist.cpp b/bacula/src/qt-console/joblist/joblist.cpp index 56078a5d0d..532507e5af 100644 --- a/bacula/src/qt-console/joblist/joblist.cpp +++ b/bacula/src/qt-console/joblist/joblist.cpp @@ -31,9 +31,9 @@ * Dirk Bartley, March 2007 */ +#include "bat.h" #include #include -#include "bat.h" #include "joblist.h" #include "restore.h" #include "joblog/joblog.h" diff --git a/bacula/src/qt-console/main.cpp b/bacula/src/qt-console/main.cpp index 5c1b8bde8a..ab99bace1b 100644 --- a/bacula/src/qt-console/main.cpp +++ b/bacula/src/qt-console/main.cpp @@ -35,9 +35,9 @@ */ +#include "bat.h" #include #include -#include "bat.h" MainWin *mainWin; QApplication *app; diff --git a/bacula/src/qt-console/mediaedit/mediaedit.cpp b/bacula/src/qt-console/mediaedit/mediaedit.cpp index f9914bb5a3..a1ff69eadc 100644 --- a/bacula/src/qt-console/mediaedit/mediaedit.cpp +++ b/bacula/src/qt-console/mediaedit/mediaedit.cpp @@ -31,12 +31,11 @@ * Dirk Bartley, March 2007 */ +#include "bat.h" #include #include #include -#include "bat.h" #include "mediaedit.h" -#include /* * A constructor diff --git a/bacula/src/qt-console/medialist/medialist.cpp b/bacula/src/qt-console/medialist/medialist.cpp index bf891fa4c1..9189f1fcbe 100644 --- a/bacula/src/qt-console/medialist/medialist.cpp +++ b/bacula/src/qt-console/medialist/medialist.cpp @@ -35,10 +35,10 @@ * */ +#include "bat.h" #include #include #include -#include "bat.h" #include "medialist.h" #include "mediaedit/mediaedit.h" #include "joblist/joblist.h" diff --git a/bacula/src/qt-console/pages.cpp b/bacula/src/qt-console/pages.cpp index 6823c3ec2d..7325e5092d 100644 --- a/bacula/src/qt-console/pages.cpp +++ b/bacula/src/qt-console/pages.cpp @@ -31,8 +31,8 @@ * Dirk Bartley, March 2007 */ -#include "pages.h" #include "bat.h" +#include "pages.h" /* A global function */ bool isWin32Path(QString &fullPath) diff --git a/bacula/src/qt-console/status/clientstat.cpp b/bacula/src/qt-console/status/clientstat.cpp index c215cccefb..e722552895 100644 --- a/bacula/src/qt-console/status/clientstat.cpp +++ b/bacula/src/qt-console/status/clientstat.cpp @@ -31,9 +31,9 @@ * Dirk Bartley, March 2007 */ +#include "bat.h" #include #include -#include "bat.h" #include "clientstat.h" /* diff --git a/bacula/src/qt-console/status/dirstat.cpp b/bacula/src/qt-console/status/dirstat.cpp index 792b33f93b..e3bda8bec1 100644 --- a/bacula/src/qt-console/status/dirstat.cpp +++ b/bacula/src/qt-console/status/dirstat.cpp @@ -31,9 +31,9 @@ * Dirk Bartley, March 2007 */ +#include "bat.h" #include #include -#include "bat.h" #include "dirstat.h" /* diff --git a/bacula/src/qt-console/status/storstat.cpp b/bacula/src/qt-console/status/storstat.cpp index fa4a41d979..f67a131cab 100644 --- a/bacula/src/qt-console/status/storstat.cpp +++ b/bacula/src/qt-console/status/storstat.cpp @@ -31,9 +31,9 @@ * Dirk Bartley, March 2007 */ +#include "bat.h" #include #include -#include "bat.h" #include "storstat.h" #include "mount/mount.h" diff --git a/bacula/src/qt-console/storage/storage.cpp b/bacula/src/qt-console/storage/storage.cpp index 4c6c7dce12..40b3b8cdb2 100644 --- a/bacula/src/qt-console/storage/storage.cpp +++ b/bacula/src/qt-console/storage/storage.cpp @@ -35,9 +35,9 @@ * */ +#include "bat.h" #include #include -#include "bat.h" #include "storage.h" #include "label/label.h" #include "mount/mount.h" diff --git a/bacula/src/qt-console/util/comboutil.cpp b/bacula/src/qt-console/util/comboutil.cpp index 5b5cf4d70e..17f68fed8e 100644 --- a/bacula/src/qt-console/util/comboutil.cpp +++ b/bacula/src/qt-console/util/comboutil.cpp @@ -35,10 +35,10 @@ * */ +#include "bat.h" #include #include #include -#include "bat.h" #include "fmtwidgetitem.h" #include "comboutil.h" diff --git a/bacula/src/qt-console/util/fmtwidgetitem.cpp b/bacula/src/qt-console/util/fmtwidgetitem.cpp index cb3a1f08b2..2bc5b28ac4 100644 --- a/bacula/src/qt-console/util/fmtwidgetitem.cpp +++ b/bacula/src/qt-console/util/fmtwidgetitem.cpp @@ -35,6 +35,7 @@ * */ +#include "bat.h" #include #include #include @@ -42,7 +43,6 @@ #include #include #include -#include "bat.h" #include "fmtwidgetitem.h" /*********************************************** diff --git a/bacula/technotes-2.5 b/bacula/technotes-2.5 index c254d2de11..f362148b5c 100644 --- a/bacula/technotes-2.5 +++ b/bacula/technotes-2.5 @@ -11,6 +11,9 @@ mixed priorities General: 07Nov08 +kes Apply Riccardo's second patch that cleans up the #include + file order + a few Win32 particularities to make bat work + on Win32. ebl Add allow_transactions flag to mysql db backend. kes Apply win32-fixes patch from Riccardo that makes the Win32 bat more stable and faster (but still slow). -- 2.39.5