Module Name:    src
Committed By:   kre
Date:           Thu Aug 24 17:18:55 UTC 2017

Modified Files:
        src/sys/kern: subr_extent.c

Log Message:
Build fix attempt ... changes affect !KERNEL (ie: userland, rump) version
of this file only.

Rather than adding meaningless {} around all uses of functions that
are #defined to nothing for userland, #define the funcs to something
that is functionally equivalent (but which appeases gcc).

Also, define KASSERT() to nothing for userland, which avoids the need
to add a #definee for mutex_owned which would otherwise be needed,
and simmultaneoiusly stops gcc from complaining about a lack of a prototype.


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/sys/kern/subr_extent.c

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

Modified files:

Index: src/sys/kern/subr_extent.c
diff -u src/sys/kern/subr_extent.c:1.83 src/sys/kern/subr_extent.c:1.84
--- src/sys/kern/subr_extent.c:1.83	Thu Aug 24 11:37:25 2017
+++ src/sys/kern/subr_extent.c	Thu Aug 24 17:18:55 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_extent.c,v 1.83 2017/08/24 11:37:25 skrll Exp $	*/
+/*	$NetBSD: subr_extent.c,v 1.84 2017/08/24 17:18:55 kre Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1998, 2007 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_extent.c,v 1.83 2017/08/24 11:37:25 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_extent.c,v 1.84 2017/08/24 17:18:55 kre Exp $");
 
 #ifdef _KERNEL
 #ifdef _KERNEL_OPT
@@ -65,6 +65,8 @@ __KERNEL_RCSID(0, "$NetBSD: subr_extent.
 #include <stdio.h>
 #include <string.h>
 
+static inline void no_op(void) { return; }
+
 /*
  * Use multi-line #defines to avoid screwing up the kernel tags file;
  * without this, ctags produces a tags file where panic() shows up
@@ -82,17 +84,18 @@ pool_get(pool, flags)		kmem_alloc((pool)
 pool_put(pool, rp)		kmem_free(rp,0)
 #define	\
 panic(a ...)			printf(a)
-#define	mutex_init(a, b, c)
-#define	mutex_destroy(a)
-#define	mutex_enter(l)
-#define	mutex_exit(l)
-#define	cv_wait(cv, lock)
-#define	cv_broadcast(cv)
-#define	cv_init(a, b)
-#define	cv_destroy(a)
+#define	mutex_init(a, b, c)	no_op()
+#define	mutex_destroy(a)	no_op()
+#define	mutex_enter(l)		no_op()
+#define	mutex_exit(l)		no_op()
+#define	cv_wait(cv, lock)	no_op()
+#define	cv_broadcast(cv)	no_op()
+#define	cv_init(a, b)		no_op()
+#define	cv_destroy(a)		no_op()
 #define	KMEM_IS_RUNNING			(1)
 #define	IPL_VM				(0)
 #define	MUTEX_DEFAULT			(0)
+#define	KASSERT(exp)
 #endif
 
 static struct pool expool;

Reply via email to