diff options
-rw-r--r-- | cpp/src/Slice/Preprocessor.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/cpp/src/Slice/Preprocessor.cpp b/cpp/src/Slice/Preprocessor.cpp index 627d19cb370..912d024ab2e 100644 --- a/cpp/src/Slice/Preprocessor.cpp +++ b/cpp/src/Slice/Preprocessor.cpp @@ -379,12 +379,12 @@ Slice::Preprocessor::printMakefileDependencies(ostream& out, Language lang, cons // // We now need to massage the result to get the desired output. - // First make it a single line. + // First remove the backslash used to escape new lines. // string::size_type pos; - while((pos = unprocessed.find("\\")) != string::npos) + while((pos = unprocessed.find("\\\n")) != string::npos) { - unprocessed.replace(pos, 1, ""); + unprocessed.replace(pos, 2, "\n"); } // @@ -401,10 +401,8 @@ Slice::Preprocessor::printMakefileDependencies(ostream& out, Language lang, cons { result = unprocessed.substr(0, pos); } - pos = unprocessed.find("\n", pos) + 1; vector<string> fullIncludePaths; - for(vector<string>::const_iterator p = includePaths.begin(); p != includePaths.end(); ++p) { fullIncludePaths.push_back(fullPath(*p)); @@ -413,7 +411,6 @@ Slice::Preprocessor::printMakefileDependencies(ostream& out, Language lang, cons // // Process each dependency. // - string sourceFile; vector<string> dependencies; |