diff --git a/reactos/tools/rbuild/automaticdependency.cpp b/reactos/tools/rbuild/automaticdependency.cpp index 166471bf060..a3c4e10ecb5 100644 --- a/reactos/tools/rbuild/automaticdependency.cpp +++ b/reactos/tools/rbuild/automaticdependency.cpp @@ -301,7 +301,7 @@ AutomaticDependency::GetModuleFiles ( const Module& module, if ( module.pch != NULL ) { - const FileLocation& pch = module.pch->file; + const FileLocation& pch = *module.pch->file; File *file = new File ( pch.directory, pch.relative_path, pch.name , false, "", true ); files.push_back ( file ); } diff --git a/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp b/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp index ff32a9cc6db..0c45284692e 100644 --- a/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp +++ b/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp @@ -399,7 +399,7 @@ CBBackend::_generate_cbproj ( const Module& module ) if ( module.pch != NULL ) { string pch_path = Path::RelativeFromDirectory ( - module.pch->file.name, + module.pch->file->name, module.output->relative_path ); header_files.push_back ( pch_path ); diff --git a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp index 5637022838f..7568a2ead4e 100644 --- a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp +++ b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp @@ -1236,8 +1236,8 @@ MingwModuleHandler::GetPrecompiledHeaderFilename () const if ( !module.pch || !use_pch ) return NULL; return new FileLocation ( IntermediateDirectory, - module.pch->file.relative_path, - ReplaceExtension ( module.pch->file.name, "_" + module.name + ".gch" ) ); + module.pch->file->relative_path, + ReplaceExtension ( module.pch->file->name, "_" + module.name + ".gch" ) ); } Rule arRule1 ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).a: $($(module_name)_OBJS) | $(INTERMEDIATE)$(SEP)$(source_dir)\n", @@ -1649,7 +1649,7 @@ MingwModuleHandler::GenerateLinkerCommand ( string linkerScriptArgument; if ( module.linkerScript != NULL ) - linkerScriptArgument = ssprintf ( " -Wl,-T,%s", backend->GetFullName ( module.linkerScript->file ).c_str () ); + linkerScriptArgument = ssprintf ( " -Wl,-T,%s", backend->GetFullName ( *module.linkerScript->file ).c_str () ); else linkerScriptArgument = ""; @@ -1807,7 +1807,7 @@ MingwModuleHandler::GenerateObjectFileTargets () string cc = ( module.host == HostTrue ? "${host_gcc}" : "${gcc}" ); string cppc = ( module.host == HostTrue ? "${host_gpp}" : "${gpp}" ); - const FileLocation& baseHeaderFile = module.pch->file; + const FileLocation& baseHeaderFile = *module.pch->file; CLEAN_FILE ( *pchFilename ); string dependencies = backend->GetFullName ( baseHeaderFile ); /* WIDL generated headers may be used */ diff --git a/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp b/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp index e1e9e082a25..01c452ab8c1 100644 --- a/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp +++ b/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp @@ -427,7 +427,7 @@ MSVCBackend::_generate_vcproj ( const Module& module ) { fprintf ( OUT, "\t\t\t\tUsePrecompiledHeader=\"2\"\r\n" ); string pch_path = Path::RelativeFromDirectory ( - module.pch->file.name, + module.pch->file->name, module.output->relative_path ); string::size_type pos = pch_path.find_last_of ("/"); if ( pos != string::npos ) diff --git a/reactos/tools/rbuild/linkerscript.cpp b/reactos/tools/rbuild/linkerscript.cpp index 6a564863c82..56c845e4153 100644 --- a/reactos/tools/rbuild/linkerscript.cpp +++ b/reactos/tools/rbuild/linkerscript.cpp @@ -22,13 +22,14 @@ LinkerScript::LinkerScript ( const XMLElement& node_, const Module& module_, - const FileLocation& file_ ) + const FileLocation *file_ ) : node(node_), module(module_), file(file_) { } LinkerScript::~LinkerScript () { + delete file; } void diff --git a/reactos/tools/rbuild/module.cpp b/reactos/tools/rbuild/module.cpp index 9402b295a74..d439e18901e 100644 --- a/reactos/tools/rbuild/module.cpp +++ b/reactos/tools/rbuild/module.cpp @@ -779,14 +779,14 @@ Module::ProcessXMLSubElement ( const XMLElement& e, if ( pos == string::npos ) { linkerScript = new LinkerScript ( - e, *this, FileLocation ( SourceDirectory, relative_path, e.value, &e ) ); + e, *this, new FileLocation ( SourceDirectory, relative_path, e.value, &e ) ); } else { string dir = e.value.substr ( 0, pos ); string name = e.value.substr ( pos + 1); linkerScript = new LinkerScript ( - e, *this, FileLocation ( SourceDirectory, relative_path + sSep + dir, name, &e ) ); + e, *this, new FileLocation ( SourceDirectory, relative_path + sSep + dir, name, &e ) ); } subs_invalid = true; } @@ -824,14 +824,14 @@ Module::ProcessXMLSubElement ( const XMLElement& e, if ( pos == string::npos ) { pch = new PchFile ( - e, *this, FileLocation ( SourceDirectory, relative_path, e.value, &e ) ); + e, *this, new FileLocation ( SourceDirectory, relative_path, e.value, &e ) ); } else { string dir = e.value.substr ( 0, pos ); string name = e.value.substr ( pos + 1); pch = new PchFile ( - e, *this, FileLocation ( SourceDirectory, relative_path + sSep + dir, name, &e ) ); + e, *this, new FileLocation ( SourceDirectory, relative_path + sSep + dir, name, &e ) ); } subs_invalid = true; } @@ -1704,11 +1704,16 @@ Property::ProcessXML() PchFile::PchFile ( const XMLElement& node_, const Module& module_, - const FileLocation& file_ ) + const FileLocation *file_ ) : node(node_), module(module_), file(file_) { } +PchFile::~PchFile() +{ + delete file; +} + void PchFile::ProcessXML() { diff --git a/reactos/tools/rbuild/rbuild.h b/reactos/tools/rbuild/rbuild.h index 1b58165303d..25986f2aaae 100644 --- a/reactos/tools/rbuild/rbuild.h +++ b/reactos/tools/rbuild/rbuild.h @@ -639,11 +639,11 @@ class LinkerScript public: const XMLElement& node; const Module& module; - FileLocation file; + const FileLocation *file; LinkerScript ( const XMLElement& node, const Module& module, - const FileLocation& file ); + const FileLocation *file ); ~LinkerScript (); void ProcessXML(); }; @@ -843,12 +843,13 @@ class PchFile public: const XMLElement& node; const Module& module; - FileLocation file; + const FileLocation *file; PchFile ( const XMLElement& node, const Module& module, - const FileLocation& file ); + const FileLocation *file ); + ~PchFile(); void ProcessXML(); };