Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 May 2018 03:50:29 +0000 (UTC)
From:      Matt Macy <mmacy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r333830 - head/sys/sys
Message-ID:  <201805190350.w4J3oTNX012008@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805190350.w4J3oTNX012008>