Module Name:    src
Committed By:   matt
Date:           Mon Jan 24 22:53:08 UTC 2011

Modified Files:
        src/sys/lib/libkern: libkern.h

Log Message:
Add KDASSERTMSG (KDASSERT already exists).


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/lib/libkern/libkern.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/lib/libkern/libkern.h
diff -u src/sys/lib/libkern/libkern.h:1.94 src/sys/lib/libkern/libkern.h:1.95
--- src/sys/lib/libkern/libkern.h:1.94	Sun Apr 25 15:39:41 2010
+++ src/sys/lib/libkern/libkern.h	Mon Jan 24 22:53:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: libkern.h,v 1.94 2010/04/25 15:39:41 rmind Exp $	*/
+/*	$NetBSD: libkern.h,v 1.95 2011/01/24 22:53:07 matt Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -223,10 +223,16 @@
 #ifndef DEBUG
 #ifdef lint
 #define	KDASSERT(e)	/* NOTHING */
+#define	KDASSERTMSG(e)	/* NOTHING */
 #else /* lint */
 #define	KDASSERT(e)	((void)0)
+#define	KDASSERTMSG(e)	((void)0)
 #endif /* lint */
 #else
+#define	KDASSERTMSG(e, msg) do {	\
+	if (__predict_false(!(e)))	\
+		panic msg;		\
+	} while (/*CONSTCOND*/ 0)
 #ifdef __STDC__
 #define	KDASSERT(e)	(__predict_true((e)) ? (void)0 :		    \
 			    kern_assert("debugging ", __FILE__, __LINE__, #e))

Reply via email to