diff options
author | Peter Carbonetto | 2017-08-14 21:50:00 -0500 |
---|---|---|
committer | GitHub | 2017-08-14 21:50:00 -0500 |
commit | a6eca6837cf1eedb3a660dd434b05389c3ec4e95 (patch) | |
tree | e11ee6858159b53b2570273f9ba3d1ac882232f7 /src/debug.h | |
parent | 3763f477e17a74942e1bf545aa9493d39bf9448e (diff) | |
parent | ff1252fe3db1ba639fe148f45b0408a4f182da0d (diff) | |
download | pangemma-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.h | 6 |
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 |