svn commit: r333830 - head/sys/sys

Matt Macy mmacy at FreeBSD.org
Sat May 19 03:50:30 UTC 2018


Author: mmacy
Date: Sat May 19 03:50:29 2018
New Revision: 333830
URL: https://svnweb.freebsd.org/changeset/base/333830

Log:
  add DBGSET macro to conditionally assign to a variable depending on INVARIANTS

Modified:
  head/sys/sys/systm.h

Modified: head/sys/sys/systm.h
==============================================================================
--- head/sys/sys/systm.h	Sat May 19 03:49:36 2018	(r333829)
+++ head/sys/sys/systm.h	Sat May 19 03:50:29 2018	(r333830)
@@ -85,6 +85,7 @@ void	kassert_panic(const char *fmt, ...)  __printflike
 #endif
 
 #ifdef	INVARIANTS		/* The option is always available */
+#define	DBGSET(lhs, rhs) lhs = (rhs)
 #define	KASSERT(exp,msg) do {						\
 	if (__predict_false(!(exp)))					\
 		kassert_panic msg;					\
@@ -96,6 +97,7 @@ void	kassert_panic(const char *fmt, ...)  __printflike
 	}								\
 } while (0)
 #else
+#define	DBGSET(lhs, rhs) rhs
 #define	KASSERT(exp,msg) do { \
 } while (0)
 


More information about the svn-src-head mailing list