summaryrefslogtreecommitdiffstats
path: root/lib/libspl
diff options
context:
space:
mode:
authorMadhav Suresh <[email protected]>2013-05-10 14:17:03 -0700
committerBrian Behlendorf <[email protected]>2013-06-19 15:14:10 -0700
commitc99c90015ece64746e20b74245caca41d1dbefe1 (patch)
treecc4e993d3796f076a2dd1de43b4a2bd38ba10cc8 /lib/libspl
parent9eaf0832ad945fb8584c39fb9aeb5e8578912aeb (diff)
Illumos #3006
3006 VERIFY[S,U,P] and ASSERT[S,U,P] frequently check if first argument is zero Reviewed by Matt Ahrens <[email protected]> Reviewed by George Wilson <[email protected]> Approved by Eric Schrock <[email protected]> References: illumos/illumos-gate@fb09f5aad449c97fe309678f3f604982b563a96f https://illumos.org/issues/3006 Requires: zfsonlinux/spl@1c6d149feb4033e4a56fb987004edc5d45288bcb Ported-by: Tim Chase <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #1509
Diffstat (limited to 'lib/libspl')
-rw-r--r--lib/libspl/include/assert.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libspl/include/assert.h b/lib/libspl/include/assert.h
index 7f145b89a..370416540 100644
--- a/lib/libspl/include/assert.h
+++ b/lib/libspl/include/assert.h
@@ -80,16 +80,19 @@ extern void __assert(const char *, const char *, int);
#define VERIFY3S(x, y, z) VERIFY3_IMPL(x, y, z, int64_t)
#define VERIFY3U(x, y, z) VERIFY3_IMPL(x, y, z, uint64_t)
#define VERIFY3P(x, y, z) VERIFY3_IMPL(x, y, z, uintptr_t)
+#define VERIFY0(x) VERIFY3_IMPL(x, ==, 0, uint64_t)
#ifdef NDEBUG
#define ASSERT3S(x, y, z) ((void)0)
#define ASSERT3U(x, y, z) ((void)0)
#define ASSERT3P(x, y, z) ((void)0)
+#define ASSERT0(x) ((void)0)
#define ASSERTV(x)
#else
#define ASSERT3S(x, y, z) VERIFY3S(x, y, z)
#define ASSERT3U(x, y, z) VERIFY3U(x, y, z)
#define ASSERT3P(x, y, z) VERIFY3P(x, y, z)
+#define ASSERT0(x) VERIFY0(x)
#define ASSERTV(x) x
#endif /* NDEBUG */