aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2018-01-01 21:33:40 +0100
committerKarel Kočí <cynerd@email.cz>2018-01-01 21:33:40 +0100
commite9a4f6a805c25334e2014869f262ee946f698bbf (patch)
treec2516baf7326162c9b5abd7b488972d0dfac7a31
parent7cc95c3a57a79864fa60de4827193fa7aadac92c (diff)
downloadqtmips-e9a4f6a805c25334e2014869f262ee946f698bbf.tar.gz
qtmips-e9a4f6a805c25334e2014869f262ee946f698bbf.tar.bz2
qtmips-e9a4f6a805c25334e2014869f262ee946f698bbf.zip
Just small move of code in qtmipsexception.h
-rw-r--r--qtmips_machine/qtmipsexception.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/qtmips_machine/qtmipsexception.h b/qtmips_machine/qtmipsexception.h
index db8cf5e..41caa87 100644
--- a/qtmips_machine/qtmipsexception.h
+++ b/qtmips_machine/qtmipsexception.h
@@ -6,8 +6,6 @@
namespace machine {
-#define QTMIPS_EXCEPTION(TYPE, REASON, EXT) (machine::QtMipsException##TYPE (QString(REASON), QString(EXT), QString(__FILE__), __LINE__))
-
// Base exception for all machine ones
class QtMipsException : public std::exception {
public:
@@ -67,6 +65,11 @@ protected:
QTMIPS_EXCEPTIONS
#undef EXCEPTION
+
+// This is helper macro for throwing QtMips exceptions
+#define QTMIPS_EXCEPTION(TYPE, REASON, EXT) (machine::QtMipsException##TYPE (QString(REASON), QString(EXT), QString(__FILE__), __LINE__))
+
+// Sanity comparison potentially throwing QtMipsExceptionSanity
#define SANITY_ASSERT(COND, MSG) do { if (!(COND)) throw QTMIPS_EXCEPTION(Sanity, "Sanity check failed (" #COND ")", MSG); } while (false)
}