summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/sys/debug.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/include/sys/debug.h b/include/sys/debug.h
index cd78171df..a4a458066 100644
--- a/include/sys/debug.h
+++ b/include/sys/debug.h
@@ -63,12 +63,15 @@ void spl_dumpstack(void);
spl_panic(__FILE__, __FUNCTION__, __LINE__, \
"%s", "VERIFY(" #cond ") failed\n"))
-#define VERIFY3_IMPL(LEFT, OP, RIGHT, TYPE, FMT, CAST) \
- (void) ((!((TYPE)(LEFT) OP (TYPE)(RIGHT))) && \
- spl_panic(__FILE__, __FUNCTION__, __LINE__, \
- "VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
- "failed (" FMT " " #OP " " FMT ")\n", \
- CAST (LEFT), CAST (RIGHT)))
+#define VERIFY3_IMPL(LEFT, OP, RIGHT, TYPE, FMT, CAST) do { \
+ TYPE _verify3_left = (TYPE)(LEFT); \
+ TYPE _verify3_right = (TYPE)(RIGHT); \
+ if (!(_verify3_left OP _verify3_right)) \
+ spl_panic(__FILE__, __FUNCTION__, __LINE__, \
+ "VERIFY3(" #LEFT " " #OP " " #RIGHT ") " \
+ "failed (" FMT " " #OP " " FMT ")\n", \
+ CAST (_verify3_left), CAST (_verify3_right)); \
+ } while (0)
#define VERIFY3B(x,y,z) VERIFY3_IMPL(x, y, z, boolean_t, "%d", (boolean_t))
#define VERIFY3S(x,y,z) VERIFY3_IMPL(x, y, z, int64_t, "%lld", (long long))