about summary refs log tree commit diff
path: root/src/debug.h
diff options
context:
space:
mode:
authorPeter Carbonetto2017-08-14 21:50:00 -0500
committerGitHub2017-08-14 21:50:00 -0500
commita6eca6837cf1eedb3a660dd434b05389c3ec4e95 (patch)
treee11ee6858159b53b2570273f9ba3d1ac882232f7 /src/debug.h
parent3763f477e17a74942e1bf545aa9493d39bf9448e (diff)
parentff1252fe3db1ba639fe148f45b0408a4f182da0d (diff)
downloadpangemma-a6eca6837cf1eedb3a660dd434b05389c3ec4e95.tar.gz
Merge pull request #68 from genenetwork/issue26.
Tests and fixes https://github.com/genetics-statistics/GEMMA/issues/26.
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