aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/3rdparty/botan/src/lib/utils/assert.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/3rdparty/botan/src/lib/utils/assert.cpp')
-rw-r--r--src/libs/3rdparty/botan/src/lib/utils/assert.cpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/libs/3rdparty/botan/src/lib/utils/assert.cpp b/src/libs/3rdparty/botan/src/lib/utils/assert.cpp
new file mode 100644
index 0000000000..cd957e00d1
--- /dev/null
+++ b/src/libs/3rdparty/botan/src/lib/utils/assert.cpp
@@ -0,0 +1,47 @@
+/*
+* Runtime assertion checking
+* (C) 2010,2012,2018 Jack Lloyd
+*
+* Botan is released under the Simplified BSD License (see license.txt)
+*/
+
+#include <botan/exceptn.h>
+#include <sstream>
+
+namespace Botan {
+
+void throw_invalid_argument(const char* message,
+ const char* func,
+ const char* file)
+ {
+ std::ostringstream format;
+
+ format << message << " in " << func << ":" << file;
+
+ throw Invalid_Argument(format.str());
+ }
+
+void assertion_failure(const char* expr_str,
+ const char* assertion_made,
+ const char* func,
+ const char* file,
+ int line)
+ {
+ std::ostringstream format;
+
+ format << "False assertion ";
+
+ if(assertion_made && assertion_made[0] != 0)
+ format << "'" << assertion_made << "' (expression " << expr_str << ") ";
+ else
+ format << expr_str << " ";
+
+ if(func)
+ format << "in " << func << " ";
+
+ format << "@" << file << ":" << line;
+
+ throw Exception(format.str());
+ }
+
+}