From 9cf1451c53ddc64de65e84ed0e9e2b764f69bb7a Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Thu, 9 Jul 2009 12:08:40 -0700 Subject: [PATCH] Add ASSERTV macro to simplify removing variables (the V in ASSERTV) when they are only used in ASSERTs which will be compiled out. --- lib/libspl/include/assert.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libspl/include/assert.h b/lib/libspl/include/assert.h index 049d467a6b..ae8ecf4053 100644 --- a/lib/libspl/include/assert.h +++ b/lib/libspl/include/assert.h @@ -85,10 +85,12 @@ _NOTE(CONSTCOND) } while (0) #define ASSERT3S(x, y, z) ((void)0) #define ASSERT3U(x, y, z) ((void)0) #define ASSERT3P(x, y, z) ((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 ASSERTV(x) x #endif /* NDEBUG */ #endif /* _LIBSPL_ASSERT_H */