From d5494f6983c27d867abc6335a2b882c98e0c7403 Mon Sep 17 00:00:00 2001 From: JJ Allaire Date: Fri, 28 Oct 2011 08:04:50 -0400 Subject: [PATCH] define assertion_failed_msg handler (required by boost 1.47) --- src/cpp/core/Assert.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/cpp/core/Assert.cpp b/src/cpp/core/Assert.cpp index 7abe4c06a11..59799addf69 100644 --- a/src/cpp/core/Assert.cpp +++ b/src/cpp/core/Assert.cpp @@ -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