From 0b755662dd4ee0bdf72f2d7544bd96517addab7f Mon Sep 17 00:00:00 2001 From: Royce Mitchell III Date: Wed, 5 Jan 2005 02:57:58 +0000 Subject: [PATCH] don't define macros that conflict with MinGW system header files, causes very cryptic error messages svn path=/branches/xmlbuildsystem/; revision=12815 --- reactos/tools/rbuild/backend/backend.cpp | 3 ++- reactos/tools/rbuild/backend/backend.h | 4 ++-- reactos/tools/rbuild/backend/mingw/mingw.cpp | 8 ++++---- reactos/tools/rbuild/backend/mingw/mingw.h | 14 +++++++------- reactos/tools/rbuild/exception.cpp | 6 ++++-- reactos/tools/rbuild/exception.h | 10 ++++------ reactos/tools/rbuild/project.cpp | 2 +- reactos/tools/rbuild/rbuild.h | 2 +- reactos/tools/rbuild/test.h | 8 ++------ reactos/tools/rbuild/tests/alltests.cpp | 15 ++------------- reactos/tools/rbuild/tests/moduletest.cpp | 2 ++ reactos/tools/rbuild/tests/projecttest.cpp | 2 ++ 12 files changed, 33 insertions(+), 43 deletions(-) diff --git a/reactos/tools/rbuild/backend/backend.cpp b/reactos/tools/rbuild/backend/backend.cpp index 89e1c42aead..148a5a5acf3 100644 --- a/reactos/tools/rbuild/backend/backend.cpp +++ b/reactos/tools/rbuild/backend/backend.cpp @@ -2,8 +2,9 @@ #pragma warning ( disable : 4786 ) // identifier was truncated to '255' characters in the debug information #endif//_MSC_VER +#include "../Rbuild.h" #include "backend.h" -Backend::Backend() +Backend::Backend ( Project& project ) : ProjectNode(project) { } diff --git a/reactos/tools/rbuild/backend/backend.h b/reactos/tools/rbuild/backend/backend.h index ab8d1415d1f..d2c434c5c57 100644 --- a/reactos/tools/rbuild/backend/backend.h +++ b/reactos/tools/rbuild/backend/backend.h @@ -6,9 +6,9 @@ class Backend { public: - Backend(); + Backend ( Project& ); protected: - Project ProjectNode; + Project& ProjectNode; }; #endif /* __BACKEND_H */ diff --git a/reactos/tools/rbuild/backend/mingw/mingw.cpp b/reactos/tools/rbuild/backend/mingw/mingw.cpp index 3d1fc6067cc..f72f780608c 100644 --- a/reactos/tools/rbuild/backend/mingw/mingw.cpp +++ b/reactos/tools/rbuild/backend/mingw/mingw.cpp @@ -1,11 +1,11 @@ #ifdef _MSC_VER #pragma warning ( disable : 4786 ) // identifier was truncated to '255' characters in the debug information #endif//_MSC_VER -#if 0 + +//#include // mingw proves it's insanity once again #include "mingw.h" -MingwBackend::MingwBackend(Project project) - : ProjectNode(project) +MingwBackend::MingwBackend(Project& project) + : Backend(project) { } -#endif diff --git a/reactos/tools/rbuild/backend/mingw/mingw.h b/reactos/tools/rbuild/backend/mingw/mingw.h index 63be7d0f3c3..fe8c9898d2e 100644 --- a/reactos/tools/rbuild/backend/mingw/mingw.h +++ b/reactos/tools/rbuild/backend/mingw/mingw.h @@ -1,12 +1,12 @@ -#ifndef __MINGW_H -#define __MINGW_H -#if 0 -#include "backend.h" +#ifndef MINGW_H +#define MINGW_H + +#include "../backend.h" class MingwBackend : public Backend { public: - MingwBackend(); + MingwBackend ( Project& ); }; -#endif -#endif /* __MINGW_H */ + +#endif /* MINGW_H */ diff --git a/reactos/tools/rbuild/exception.cpp b/reactos/tools/rbuild/exception.cpp index ec5a833645a..3ac9418e5ca 100644 --- a/reactos/tools/rbuild/exception.cpp +++ b/reactos/tools/rbuild/exception.cpp @@ -5,11 +5,13 @@ #include #include "rbuild.h" +using std::string; + Exception::Exception() { } -Exception::Exception(string message) +Exception::Exception(const string& message) { Message = message; } @@ -33,7 +35,7 @@ void Exception::SetMessage(const char* message, } -FileNotFoundException::FileNotFoundException(string filename) +FileNotFoundException::FileNotFoundException(const string& filename) : Exception ( "File '%s' not found.", filename.c_str() ) { Filename = filename; diff --git a/reactos/tools/rbuild/exception.h b/reactos/tools/rbuild/exception.h index 94a47e8cc48..8adec17e081 100644 --- a/reactos/tools/rbuild/exception.h +++ b/reactos/tools/rbuild/exception.h @@ -3,15 +3,13 @@ #include -using std::string; - class Exception { public: - Exception(string message); + Exception(const std::string& message); Exception(const char* format, ...); - string Message; + std::string Message; protected: Exception(); void SetMessage(const char* message, @@ -22,8 +20,8 @@ protected: class FileNotFoundException : public Exception { public: - FileNotFoundException(string filename); - string Filename; + FileNotFoundException(const std::string& filename); + std::string Filename; }; diff --git a/reactos/tools/rbuild/project.cpp b/reactos/tools/rbuild/project.cpp index f4ed30e52f7..9def258293a 100644 --- a/reactos/tools/rbuild/project.cpp +++ b/reactos/tools/rbuild/project.cpp @@ -11,7 +11,7 @@ Project::Project() { } -Project::Project(string filename) +Project::Project(const string& filename) { if ( !xmlfile.open ( filename ) ) throw FileNotFoundException ( filename ); diff --git a/reactos/tools/rbuild/rbuild.h b/reactos/tools/rbuild/rbuild.h index 60130401050..d1d5b93db21 100644 --- a/reactos/tools/rbuild/rbuild.h +++ b/reactos/tools/rbuild/rbuild.h @@ -18,7 +18,7 @@ public: std::vector modules; Project (); - Project ( string filename ); + Project ( const std::string& filename ); ~Project (); void ProcessXML ( const XMLElement& e, const std::string& path ); private: diff --git a/reactos/tools/rbuild/test.h b/reactos/tools/rbuild/test.h index fd50f514147..3b397866675 100644 --- a/reactos/tools/rbuild/test.h +++ b/reactos/tools/rbuild/test.h @@ -22,12 +22,8 @@ protected: int actual, const char* file, int line); - void AreEqual(string expected, - string actual, - const char* file, - int line); - void AreEqual(const char* expected, - string actual, + void AreEqual(const std::string& expected, + const std::string& actual, const char* file, int line); void AreNotEqual(int expected, diff --git a/reactos/tools/rbuild/tests/alltests.cpp b/reactos/tools/rbuild/tests/alltests.cpp index 04aa80146c5..e4bd899bb45 100644 --- a/reactos/tools/rbuild/tests/alltests.cpp +++ b/reactos/tools/rbuild/tests/alltests.cpp @@ -61,8 +61,8 @@ void BaseTest::AreEqual(int expected, } } -void BaseTest::AreEqual(string expected, - string actual, +void BaseTest::AreEqual(const std::string& expected, + const std::string& actual, const char* file, int line) { @@ -76,17 +76,6 @@ void BaseTest::AreEqual(string expected, } } -void BaseTest::AreEqual(const char* expected, - string actual, - const char* file, - int line) -{ - AreEqual(string(expected), - actual, - file, - line); -} - void BaseTest::AreNotEqual(int expected, int actual, const char* file, diff --git a/reactos/tools/rbuild/tests/moduletest.cpp b/reactos/tools/rbuild/tests/moduletest.cpp index c707bf7c631..ec7a5788c02 100644 --- a/reactos/tools/rbuild/tests/moduletest.cpp +++ b/reactos/tools/rbuild/tests/moduletest.cpp @@ -1,5 +1,7 @@ #include "test.h" +using std::string; + void ModuleTest::Run() { string projectFilename ( "tests/data/module.xml" ); diff --git a/reactos/tools/rbuild/tests/projecttest.cpp b/reactos/tools/rbuild/tests/projecttest.cpp index c53dd504522..314304f8902 100644 --- a/reactos/tools/rbuild/tests/projecttest.cpp +++ b/reactos/tools/rbuild/tests/projecttest.cpp @@ -1,5 +1,7 @@ #include "test.h" +using std::string; + void ProjectTest::Run() { string projectFilename ( "tests/data/project.xml" );