Avoid duplicating error messages with g++.

This commit is contained in:
Sylvain Pion 2007-11-21 16:44:44 +00:00
parent 93caf16415
commit dddf37f5cc
1 changed files with 22 additions and 12 deletions

View File

@ -58,13 +58,17 @@ _standard_error_handler(
int line,
const char* msg )
{
#ifdef __GNUG__
// After g++ 3.4, std::terminate defaults to printing to std::cerr itself.
if (_error_behaviour == THROW_EXCEPTION)
return;
#endif
std::cerr << "CGAL error: " << what << " violation!" << std::endl
<< "Expr: " << expr << std::endl
<< "Expression : " << expr << std::endl
<< "File : " << file << std::endl
<< "Line: " << line << std::endl;
if ( msg != 0)
std::cerr << "Explanation:" << msg << std::endl;
std::cerr << "Refer to the bug-reporting instructions at http://www.cgal.org/bug_report.html"
<< "Line : " << line << std::endl
<< "Explanation: " << msg << std::endl
<< "Refer to the bug-reporting instructions at http://www.cgal.org/bug_report.html"
<< std::endl;
}
@ -78,12 +82,18 @@ _standard_warning_handler( const char *,
int line,
const char* msg )
{
#ifdef __GNUG__
// After g++ 3.4, std::terminate defaults to printing to std::cerr itself.
if (_warning_behaviour == THROW_EXCEPTION)
return;
#endif
std::cerr << "CGAL warning: check violation!" << std::endl
<< "Expr: " << expr << std::endl
<< "Expression : " << expr << std::endl
<< "File : " << file << std::endl
<< "Line: " << line << std::endl;
if ( msg != 0)
std::cerr << "Explanation:" << msg << std::endl;
<< "Line : " << line << std::endl
<< "Explanation: " << msg << std::endl
<< "Refer to the bug-reporting instructions at http://www.cgal.org/bug_report.html"
<< std::endl;
}
// default handler settings