Add ASSERTV macro to simplify removing variables (the V in ASSERTV)

when they are only used in ASSERTs which will be compiled out.
This commit is contained in:
Brian Behlendorf 2009-07-09 12:08:40 -07:00
parent 69d8cabd76
commit 9cf1451c53
1 changed files with 2 additions and 0 deletions

View File

@ -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 */