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

[Bacula-devel] patch: include reorder for win32 bat


Hello,
bacula on win32 redefines some system structures and functions.
Not the safest thing to do, IMHO.
Anyway, this patch tweaks bat includes to at least pull in only the bacula versions and not a mix of the two.

Riccardo
Index: bacula/src/qt-console/pages.cpp
===================================================================
--- bacula/src/qt-console/pages.cpp	(revision 8015)
+++ bacula/src/qt-console/pages.cpp	(working copy)
@@ -31,8 +31,8 @@
  *   Dirk Bartley, March 2007
  */
 
+#include "bat.h"
 #include "pages.h"
-#include "bat.h"
 
 /* A global function */
 bool isWin32Path(QString &fullPath) 
Index: bacula/src/qt-console/status/storstat.cpp
===================================================================
--- bacula/src/qt-console/status/storstat.cpp	(revision 8015)
+++ bacula/src/qt-console/status/storstat.cpp	(working copy)
@@ -31,9 +31,9 @@
  *   Dirk Bartley, March 2007
  */
  
+#include "bat.h"
 #include <QAbstractEventDispatcher>
 #include <QTableWidgetItem>
-#include "bat.h"
 #include "storstat.h"
 #include "mount/mount.h"
 
Index: bacula/src/qt-console/status/clientstat.cpp
===================================================================
--- bacula/src/qt-console/status/clientstat.cpp	(revision 8015)
+++ bacula/src/qt-console/status/clientstat.cpp	(working copy)
@@ -31,9 +31,9 @@
  *   Dirk Bartley, March 2007
  */
  
+#include "bat.h"
 #include <QAbstractEventDispatcher>
 #include <QTableWidgetItem>
-#include "bat.h"
 #include "clientstat.h"
 
 /*
Index: bacula/src/qt-console/status/dirstat.cpp
===================================================================
--- bacula/src/qt-console/status/dirstat.cpp	(revision 8015)
+++ bacula/src/qt-console/status/dirstat.cpp	(working copy)
@@ -31,9 +31,9 @@
  *   Dirk Bartley, March 2007
  */
  
+#include "bat.h"
 #include <QAbstractEventDispatcher>
 #include <QTableWidgetItem>
-#include "bat.h"
 #include "dirstat.h"
 
 /*
Index: bacula/src/qt-console/fileset/fileset.cpp
===================================================================
--- bacula/src/qt-console/fileset/fileset.cpp	(revision 8015)
+++ bacula/src/qt-console/fileset/fileset.cpp	(working copy)
@@ -35,9 +35,9 @@
  *
  */ 
 
+#include "bat.h"
 #include <QAbstractEventDispatcher>
 #include <QMenu>
-#include "bat.h"
 #include "fileset/fileset.h"
 #include "util/fmtwidgetitem.h"
 
Index: bacula/src/qt-console/bat_conf.cpp
===================================================================
--- bacula/src/qt-console/bat_conf.cpp	(revision 8015)
+++ bacula/src/qt-console/bat_conf.cpp	(working copy)
@@ -69,7 +69,11 @@
  * 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
Index: bacula/src/qt-console/clients/clients.cpp
===================================================================
--- bacula/src/qt-console/clients/clients.cpp	(revision 8015)
+++ bacula/src/qt-console/clients/clients.cpp	(working copy)
@@ -35,9 +35,9 @@
  *
  */ 
 
+#include "bat.h"
 #include <QAbstractEventDispatcher>
 #include <QMenu>
-#include "bat.h"
 #include "clients/clients.h"
 #include "run/run.h"
 #include "status/clientstat.h"
Index: bacula/src/qt-console/storage/storage.cpp
===================================================================
--- bacula/src/qt-console/storage/storage.cpp	(revision 8015)
+++ bacula/src/qt-console/storage/storage.cpp	(working copy)
@@ -35,9 +35,9 @@
  *
  */ 
 
+#include "bat.h"
 #include <QAbstractEventDispatcher>
 #include <QMenu>
-#include "bat.h"
 #include "storage.h"
 #include "label/label.h"
 #include "mount/mount.h"
Index: bacula/src/qt-console/main.cpp
===================================================================
--- bacula/src/qt-console/main.cpp	(revision 8015)
+++ bacula/src/qt-console/main.cpp	(working copy)
@@ -35,9 +35,9 @@
  */ 
 
 
+#include "bat.h"
 #include <QApplication>
 #include <QTranslator>
-#include "bat.h"
 
 MainWin *mainWin;
 QApplication *app;
Index: bacula/src/qt-console/medialist/medialist.cpp
===================================================================
--- bacula/src/qt-console/medialist/medialist.cpp	(revision 8015)
+++ bacula/src/qt-console/medialist/medialist.cpp	(working copy)
@@ -35,10 +35,10 @@
  *
  */ 
 
+#include "bat.h"
 #include <QAbstractEventDispatcher>
 #include <QMenu>
 #include <math.h>
-#include "bat.h"
 #include "medialist.h"
 #include "mediaedit/mediaedit.h"
 #include "joblist/joblist.h"
Index: bacula/src/qt-console/jobgraphs/jobplot.cpp
===================================================================
--- bacula/src/qt-console/jobgraphs/jobplot.cpp	(revision 8015)
+++ bacula/src/qt-console/jobgraphs/jobplot.cpp	(working copy)
@@ -35,8 +35,8 @@
  *
  */ 
 
+#include "bat.h"
 #include <QtGui>
-#include "bat.h"
 #include "util/comboutil.h"
 #include "jobgraphs/jobplot.h"
 
Index: bacula/src/qt-console/mediaedit/mediaedit.cpp
===================================================================
--- bacula/src/qt-console/mediaedit/mediaedit.cpp	(revision 8015)
+++ bacula/src/qt-console/mediaedit/mediaedit.cpp	(working copy)
@@ -31,12 +31,11 @@
  *   Dirk Bartley, March 2007
  */
  
+#include "bat.h"
 #include <QAbstractEventDispatcher>
 #include <QTableWidgetItem>
 #include <QMessageBox>
-#include "bat.h"
 #include "mediaedit.h"
-#include <inttypes.h>
 
 /*
  * A constructor 
Index: bacula/src/qt-console/bat.h
===================================================================
--- bacula/src/qt-console/bat.h	(revision 8015)
+++ bacula/src/qt-console/bat.h	(working copy)
@@ -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 <QtGui>
 #include <QtCore>
+#include "bacula.h"
 #include "mainwin.h"
-#include "bacula.h"
 #include "bat_conf.h"
 #include "jcr.h"
 #include "console.h"
Index: bacula/src/qt-console/joblist/joblist.cpp
===================================================================
--- bacula/src/qt-console/joblist/joblist.cpp	(revision 8015)
+++ bacula/src/qt-console/joblist/joblist.cpp	(working copy)
@@ -31,9 +31,9 @@
  *   Dirk Bartley, March 2007
  */
  
+#include "bat.h"
 #include <QAbstractEventDispatcher>
 #include <QTableWidgetItem>
-#include "bat.h"
 #include "joblist.h"
 #include "restore.h"
 #include "joblog/joblog.h"
Index: bacula/src/qt-console/util/fmtwidgetitem.cpp
===================================================================
--- bacula/src/qt-console/util/fmtwidgetitem.cpp	(revision 8015)
+++ bacula/src/qt-console/util/fmtwidgetitem.cpp	(working copy)
@@ -35,6 +35,7 @@
  *
  */ 
 
+#include "bat.h"
 #include <QTreeWidgetItem>
 #include <QTableWidget>
 #include <QTableWidgetItem>
@@ -42,7 +43,6 @@
 #include <QString>
 #include <QStringList>
 #include <math.h>
-#include "bat.h"
 #include "fmtwidgetitem.h"
 
 /***********************************************
Index: bacula/src/qt-console/util/comboutil.cpp
===================================================================
--- bacula/src/qt-console/util/comboutil.cpp	(revision 8015)
+++ bacula/src/qt-console/util/comboutil.cpp	(working copy)
@@ -35,10 +35,10 @@
  *
  */
 
+#include "bat.h"
 #include <QComboBox>
 #include <QString>
 #include <QStringList>
-#include "bat.h"
 #include "fmtwidgetitem.h"
 #include "comboutil.h"
 
-------------------------------------------------------------------------
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.