diff options
author | Benoit Foucher <benoit@zeroc.com> | 2008-05-08 01:44:33 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2008-05-08 01:44:33 +0200 |
commit | 8cb3b40ea72e5cdb59f423dbc302e443f0859a2d (patch) | |
tree | 884a605384b2ec936b4dd3f82a00ba55e8dfe3c7 /cpp/src/Slice/Preprocessor.cpp | |
parent | bugs 1943, 3081 - IceStorm failures with ssl (diff) | |
download | ice-8cb3b40ea72e5cdb59f423dbc302e443f0859a2d.tar.bz2 ice-8cb3b40ea72e5cdb59f423dbc302e443f0859a2d.tar.xz ice-8cb3b40ea72e5cdb59f423dbc302e443f0859a2d.zip |
Fixed bug 3102
Diffstat (limited to 'cpp/src/Slice/Preprocessor.cpp')
-rwxr-xr-x | cpp/src/Slice/Preprocessor.cpp | 31 |
1 files changed, 19 insertions, 12 deletions
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<strin { fullIncludePaths.push_back(fullPath(*p)); } + string absoluteFileName = fullPath(_fileName); // // Process each dependency. @@ -294,26 +295,32 @@ Slice::Preprocessor::printMakefileDependencies(Language lang, const vector<strin { end += 4; string file = IceUtilInternal::trim(unprocessed.substr(pos, end - pos)); - if(isAbsolute(file)) { - // - // Transform back full paths generated by mcpp to paths relative to the specified - // include paths. - // - string newFile = file; - for(vector<string>::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<string>::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; } // |