aboutsummaryrefslogtreecommitdiff
path: root/src/debug.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/debug.h')
-rw-r--r--src/debug.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/debug.h b/src/debug.h
index fafebcf..3fbe9e0 100644
--- a/src/debug.h
+++ b/src/debug.h
@@ -7,10 +7,15 @@
// enforce works like assert but also when NDEBUG is set (i.e., it
// always works). enforce_msg prints message instead of expr
+#define ROUND(f) round(f * 10000.)/10000
#if defined NDEBUG
#define debug_msg(msg)
+#define assert_issue(is_issue, expr)
#else
#define debug_msg(msg) cout << "**** DEBUG: " << msg << endl;
+#define assert_issue(is_issue, expr) \
+ ((is_issue) ? enforce_msg(expr,"FAIL: ISSUE assert") : __ASSERT_VOID_CAST(0))
+
#endif
/* This prints an "Assertion failed" message and aborts. */
@@ -49,4 +54,5 @@ inline void __enforce_fail(const char *__assertion, const char *__file,
: __enforce_fail(gsl_strerror(COMBINE(res, __LINE__)), __FILE__, \
__LINE__, __ASSERT_FUNCTION))
+
#endif