mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-01-27 18:34:22 +03:00
Add IMPLY() and EQUIV() macros
Added for upstream compatibility, they are of the form: * IMPLY(a, b) - if (a) then (b) * EQUIV(a, b) - if (a) then (b) *AND* if (b) then (a) Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
parent
2345368646
commit
5acb2307b2
@ -92,6 +92,8 @@ void spl_dumpstack(void);
|
|||||||
#define ASSERT3U(x,y,z) ((void)0)
|
#define ASSERT3U(x,y,z) ((void)0)
|
||||||
#define ASSERT3P(x,y,z) ((void)0)
|
#define ASSERT3P(x,y,z) ((void)0)
|
||||||
#define ASSERT0(x) ((void)0)
|
#define ASSERT0(x) ((void)0)
|
||||||
|
#define IMPLY(A, B) ((void)0)
|
||||||
|
#define EQUIV(A, B) ((void)0)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Debugging enabled (--enable-debug)
|
* Debugging enabled (--enable-debug)
|
||||||
@ -105,6 +107,14 @@ void spl_dumpstack(void);
|
|||||||
#define ASSERT3U(x,y,z) VERIFY3U(x, y, z)
|
#define ASSERT3U(x,y,z) VERIFY3U(x, y, z)
|
||||||
#define ASSERT3P(x,y,z) VERIFY3P(x, y, z)
|
#define ASSERT3P(x,y,z) VERIFY3P(x, y, z)
|
||||||
#define ASSERT0(x) VERIFY0(x)
|
#define ASSERT0(x) VERIFY0(x)
|
||||||
|
#define IMPLY(A, B) \
|
||||||
|
((void)(((!(A)) || (B)) || \
|
||||||
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
|
"(" #A ") implies (" #B ")")))
|
||||||
|
#define EQUIV(A, B) \
|
||||||
|
((void)((!!(A) == !!(B)) || \
|
||||||
|
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
|
||||||
|
"(" #A ") is equivalent to (" #B ")")))
|
||||||
|
|
||||||
#endif /* NDEBUG */
|
#endif /* NDEBUG */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user