Botan 1.10.17
assert.cpp
Go to the documentation of this file.
1/*
2* Runtime assertion checking
3* (C) 2010 Jack Lloyd
4*
5* Distributed under the terms of the Botan license
6*/
7
8#include <botan/internal/assert.h>
9#include <botan/exceptn.h>
10#include <sstream>
11
12namespace Botan {
13
14void assertion_failure(const char* expr_str,
15 const char* msg,
16 const char* func,
17 const char* file,
18 int line)
19 {
20 std::ostringstream format;
21
22 format << "Assertion " << expr_str << " failed ";
23
24 if(msg)
25 format << "(" << msg << ") ";
26
27 if(func)
28 format << "in " << func << " ";
29
30 format << "@" << file << ":" << line;
31
32 throw Internal_Error(format.str());
33 }
34
35}
void assertion_failure(const char *expr_str, const char *msg, const char *func, const char *file, int line)
Definition assert.cpp:14
Internal_Error(const std::string &err)
Definition exceptn.h:47