From 44726714322ca0b75628e234229f4583a480d7ec Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Mon, 14 Jul 2014 17:01:47 -0400 Subject: ctest_memcheck: Add support for memory and leak sanitizer. This adds support for memory and leak sanitizers. This is built into clang and gcc 4.8 and new compilers. It is activated with a -f switch during compile. --- Source/cmXMLParser.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'Source/cmXMLParser.cxx') diff --git a/Source/cmXMLParser.cxx b/Source/cmXMLParser.cxx index a73fd70326..391b874d1a 100644 --- a/Source/cmXMLParser.cxx +++ b/Source/cmXMLParser.cxx @@ -20,6 +20,8 @@ cmXMLParser::cmXMLParser() { this->Parser = 0; this->ParseError = 0; + this->ReportCallback = 0; + this->ReportCallbackData = 0; } //---------------------------------------------------------------------------- @@ -233,6 +235,13 @@ void cmXMLParser::ReportXmlParseError() //---------------------------------------------------------------------------- void cmXMLParser::ReportError(int line, int, const char* msg) { - std::cerr << "Error parsing XML in stream at line " - << line << ": " << msg << std::endl; + if(this->ReportCallback) + { + this->ReportCallback(line, msg, this->ReportCallbackData); + } + else + { + std::cerr << "Error parsing XML in stream at line " + << line << ": " << msg << std::endl; + } } -- cgit v1.2.1