summaryrefslogtreecommitdiff
path: root/src/common/include/gudhi/Debug_utils.h
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-03-22 16:07:08 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-03-22 16:07:08 +0000
commit5276b0a9e344ed0bb4fdb8b079f2ce86649d12a4 (patch)
treea48b71b30df671906508fdf489b242850e5f47a7 /src/common/include/gudhi/Debug_utils.h
parentce097f4fd26faf1b52d7a50769f809feeab60c3d (diff)
GUDHI_CHECK was not intuitive.
Reverse GUDHI_CHECK calls. No exception when no point is given in contrction. git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/alphashapes@1070 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: bf6a08d48b5b29a5b24bf5107116e399dfc0a6bc
Diffstat (limited to 'src/common/include/gudhi/Debug_utils.h')
-rw-r--r--src/common/include/gudhi/Debug_utils.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/include/gudhi/Debug_utils.h b/src/common/include/gudhi/Debug_utils.h
index 48d61fef..7573a9db 100644
--- a/src/common/include/gudhi/Debug_utils.h
+++ b/src/common/include/gudhi/Debug_utils.h
@@ -29,12 +29,12 @@
#define GUDHI_DEBUG
#endif
-// GUDHI_CHECK throw an exception on condition in debug mode, but does nothing in release mode
+// GUDHI_CHECK throw an exception if expression is false in debug mode, but does nothing in release mode
// Could assert in release mode, but cmake sets NDEBUG (for "NO DEBUG") in this mode, means assert does nothing.
#ifdef GUDHI_DEBUG
- #define GUDHI_CHECK(cond, excpt) if (cond) throw excpt
+ #define GUDHI_CHECK(expression, excpt) if ((expression) == 0) throw excpt
#else
- #define GUDHI_CHECK(cond, excpt) (void) 0
+ #define GUDHI_CHECK(expression, excpt) (void) 0
#endif
#define PRINT(a) std::cerr << #a << ": " << (a) << " (DISP)" << std::endl