From 8cb3b40ea72e5cdb59f423dbc302e443f0859a2d Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Thu, 8 May 2008 01:44:33 +0200 Subject: Fixed bug 3102 --- cpp/src/Slice/Preprocessor.cpp | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'cpp/src/Slice/Preprocessor.cpp') diff --git a/cpp/src/Slice/Preprocessor.cpp b/cpp/src/Slice/Preprocessor.cpp index f6eb84f5ddb..fb7bef59d16 100755 --- a/cpp/src/Slice/Preprocessor.cpp +++ b/cpp/src/Slice/Preprocessor.cpp @@ -285,6 +285,7 @@ Slice::Preprocessor::printMakefileDependencies(Language lang, const vector::const_iterator p = fullIncludePaths.begin(); p != fullIncludePaths.end(); ++p) + if(file == absoluteFileName) + { + file = _fileName; + } + else { - if(file.compare(0, p->length(), *p) == 0) + // + // Transform back full paths generated by mcpp to paths relative to the specified + // include paths. + // + string newFile = file; + for(vector::const_iterator p = fullIncludePaths.begin(); p != fullIncludePaths.end(); ++p) { - string s = includePaths[p - fullIncludePaths.begin()] + file.substr(p->length()); - if(isAbsolute(newFile) || s.size() < newFile.size()) + if(file.compare(0, p->length(), *p) == 0) { - newFile = s; + string s = includePaths[p - fullIncludePaths.begin()] + file.substr(p->length()); + if(isAbsolute(newFile) || s.size() < newFile.size()) + { + newFile = s; + } } } + file = newFile; } - file = newFile; } // -- cgit v1.2.3