diff --git a/include/util/assert.hpp b/include/util/assert.hpp deleted file mode 100644 index d9bfb9542..000000000 --- a/include/util/assert.hpp +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef OSRM_ASSERT_HPP -#define OSRM_ASSERT_HPP - -#include - -#include - -namespace osrm -{ -namespace util -{ -// Assertion type to be thrown for stack unwinding -struct assertionError final : std::logic_error -{ - assertionError(const char *msg) : std::logic_error{msg} {} -}; -} -} - -#endif diff --git a/src/util/assert.cpp b/src/util/assert.cpp index 70517840a..03c37adc5 100644 --- a/src/util/assert.cpp +++ b/src/util/assert.cpp @@ -1,16 +1,17 @@ -#include "util/assert.hpp" +#include -#include +#include +#include namespace { -// We throw to guarantee for stack-unwinding and therefore our destructors being called. +// We hard-abort on assertion violations. void assertion_failed_msg_helper( char const *expr, char const *msg, char const *function, char const *file, long line) { - std::ostringstream fmt; - fmt << file << ":" << line << "\nin: " << function << ": " << expr << "\n" << msg; - throw osrm::util::assertionError{fmt.str().c_str()}; + std::cerr << "[assert] " << file << ":" << line << "\nin: " << function << ": " << expr << "\n" + << msg; + std::terminate(); } }