summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/Preprocessor.cpp
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2009-06-09 16:02:19 +1000
committerMichi Henning <michi@zeroc.com>2009-06-09 16:02:19 +1000
commit33a565ce5904e545aa77febad74f70a4848435bc (patch)
tree5a2704b9de85823efd8475abf45b373c06c5f535 /cpp/src/Slice/Preprocessor.cpp
parentAdded workaround for mcpp bug (diff)
downloadice-33a565ce5904e545aa77febad74f70a4848435bc.tar.bz2
ice-33a565ce5904e545aa77febad74f70a4848435bc.tar.xz
ice-33a565ce5904e545aa77febad74f70a4848435bc.zip
Bug 4064 - Having file include itself == BAD
Problem is that mcpp doesn't return non-zero status, even though it reports a fatal error. Added work-around that parses mcpp error output and, if a line contains "error:", sets the status to 1.
Diffstat (limited to 'cpp/src/Slice/Preprocessor.cpp')
-rw-r--r--cpp/src/Slice/Preprocessor.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/cpp/src/Slice/Preprocessor.cpp b/cpp/src/Slice/Preprocessor.cpp
index 832f0ae5756..c4ec27452e3 100644
--- a/cpp/src/Slice/Preprocessor.cpp
+++ b/cpp/src/Slice/Preprocessor.cpp
@@ -173,6 +173,14 @@ Slice::Preprocessor::preprocess(bool keepComments)
for(vector<string>::const_iterator i = messages.begin(); i != messages.end(); ++i)
{
emitRaw(i->c_str());
+
+ //
+ // MCPP FIX: mcpp does not always return non-zero exit status when there is an error.
+ //
+ if(i->find("error:") != string::npos)
+ {
+ status = 1;
+ }
}
}