diff options
author | Karel Kočí <cynerd@email.cz> | 2018-01-01 21:33:40 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2018-01-01 21:33:40 +0100 |
commit | e9a4f6a805c25334e2014869f262ee946f698bbf (patch) | |
tree | c2516baf7326162c9b5abd7b488972d0dfac7a31 /qtmips_machine | |
parent | 7cc95c3a57a79864fa60de4827193fa7aadac92c (diff) | |
download | qtmips-e9a4f6a805c25334e2014869f262ee946f698bbf.tar.gz qtmips-e9a4f6a805c25334e2014869f262ee946f698bbf.tar.bz2 qtmips-e9a4f6a805c25334e2014869f262ee946f698bbf.zip |
Just small move of code in qtmipsexception.h
Diffstat (limited to 'qtmips_machine')
-rw-r--r-- | qtmips_machine/qtmipsexception.h | 7 |
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) } |