Skip to content

Commit

Permalink
define assertion_failed_msg handler (required by boost 1.47)
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire committed Oct 28, 2011
1 parent 222f6cd commit d5494f6
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/cpp/core/Assert.cpp
Expand Up @@ -47,6 +47,29 @@ void assertion_failed(char const * expr,

}

void assertion_failed_msg(char const * expr,
char const * msg,
char const * function,
char const * file,
long line)
{
// derive location
ErrorLocation location(function, file, line);

// always log the failure
std::string message = "ASSERTION FAILED: " + std::string(expr) +
" - " + std::string(msg);
core::log::logWarningMessage(message, location);

#ifndef NDEBUG
#ifdef _WIN32
DebugBreak();
#else
::raise(SIGTRAP);
#endif
#endif
}

} // namespace boost


Expand Down

0 comments on commit d5494f6

Please sign in to comment.