/* * Runtime assertion checking * (C) 2010 Jack Lloyd * * Distributed under the terms of the Botan license */ #include #include #include namespace Botan { void assertion_failure(const char* expr_str, const char* msg, const char* func, const char* file, int line) { std::ostringstream format; format << "Assertion " << expr_str << " failed "; if(msg && msg[0] != 0) format << "(" << msg << ") "; if(func) format << "in " << func << " "; format << "@" << file << ":" << line; throw Internal_Error(format.str()); } }