summaryrefslogtreecommitdiff
path: root/src/macros.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/macros.h')
-rw-r--r--src/macros.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/macros.h b/src/macros.h
index 2459230..4556a09 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -2,3 +2,25 @@
#define PRINT_ATOM_FIELD(object, field) \
debug.nospace() << "\t" << #field << ": " << object.field << Qt::endl
+
+#define VERIFY_RETURN_VAL(cond, val) \
+ if (!cond) { \
+ return val; \
+ }
+
+#define VERIFY_CRIT_RETURN(cond) \
+ if (Q_UNLIKELY(!cond)) { \
+ qCritical() << #cond " == false"; \
+ return; \
+ }
+
+#define VERIFY_CRIT_RETURN_VAL(cond, val) \
+ if (Q_UNLIKELY(!cond)) { \
+ qCritical() << #cond " == false"; \
+ return val; \
+ }
+
+#define VERIFY_CONTINUE(cond) \
+ if (!cond) { \
+ continue; \
+ }