diff Framework/StoneException.h @ 722:28b9e3a54200

Undo mechanism implemented (not connected to UI yet). Undo stack and measuring tools are now handled by the ViewportController. Multi-touch does not crash trackers anymore.
author Benjamin Golinvaux <bgo@osimis.io>
date Tue, 21 May 2019 10:27:54 +0200
parents b70e9be013e4
children 8e31b174ab26 712ff6ff3c19
line wrap: on
line diff
--- a/Framework/StoneException.h	Mon May 20 12:49:29 2019 +0200
+++ b/Framework/StoneException.h	Tue May 21 10:27:54 2019 +0200
@@ -113,3 +113,13 @@
 
 }
 
+// See https://isocpp.org/wiki/faq/misc-technical-issues#macros-with-multi-stmts
+// (or google "Multiple lines macro C++ faq lite" if link is dead)
+#define ORTHANC_ASSERT(cond,streamChainMessage) \
+    if (!(cond)) { \
+      std::stringstream sst; \
+      sst << "Assertion failed. Condition = \"" #cond "\" Message = \"" << streamChainMessage << "\""; \
+      std::string sstr = sst.str(); \
+      throw OrthancException(ErrorCode_InternalError,sstr.c_str()); \
+    } else (void)0
+