Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2014-03-15 04:23:47 +0400
committerFedor Indutny <fedor.indutny@gmail.com>2014-03-16 16:15:33 +0400
commit8eb76075cf5f812249c343fa26eb299d59f63fa0 (patch)
tree0b0907be880ca8637acb2f758e34d88a5abd63c4 /src/util.h
parentf6ea0c203aa08c4817c7739461f8e7015d390279 (diff)
src: deduplicate CHECK_EQ/CHECK_NE macros
DRY the macros, there is no need to define them twice depending on whether NDEBUG is defined or not.
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/util.h b/src/util.h
index e9634ce3d19..d8e0a977f95 100644
--- a/src/util.h
+++ b/src/util.h
@@ -49,15 +49,14 @@ namespace node {
do { \
if (!(expression)) abort(); \
} while (0)
-# define CHECK_EQ(a, b) CHECK((a) == (b))
-# define CHECK_NE(a, b) CHECK((a) != (b))
#else
# define ASSERT(expression) assert(expression)
# define CHECK(expression) assert(expression)
-# define CHECK_EQ(a, b) assert((a) == (b))
-# define CHECK_NE(a, b) assert((a) != (b))
#endif
+#define CHECK_EQ(a, b) CHECK((a) == (b))
+#define CHECK_NE(a, b) CHECK((a) != (b))
+
#define UNREACHABLE() abort()
// If persistent.IsWeak() == false, then do not call persistent.Reset()