From 0931dcefb398094050e44a998c8023f97adb15c6 Mon Sep 17 00:00:00 2001 From: Alfred Perlstein Date: Sun, 26 Nov 2000 21:14:17 +0000 Subject: [PATCH] Move the #define of _KERN_MUTEX_C_ so that it's before any system headers are included. System headers can include sys/mutex.h and then certain macros do not get defined. Reviewed by: jake --- sys/kern/kern_mutex.c | 7 ++++++- sys/kern/subr_turnstile.c | 7 ++++++- sys/kern/subr_witness.c | 7 ++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c index bc335c558a5f..e66e6f8e36fd 100644 --- a/sys/kern/kern_mutex.c +++ b/sys/kern/kern_mutex.c @@ -53,6 +53,12 @@ #include "opt_ddb.h" #include "opt_witness.h" +/* + * Cause non-inlined mtx_*() to be compiled. + * Must be defined early because other system headers may include mutex.h. + */ +#define _KERN_MUTEX_C_ + #include #include #include @@ -73,7 +79,6 @@ #include #include -#define _KERN_MUTEX_C_ /* Cause non-inlined mtx_*() to be compiled. */ #include /* diff --git a/sys/kern/subr_turnstile.c b/sys/kern/subr_turnstile.c index bc335c558a5f..e66e6f8e36fd 100644 --- a/sys/kern/subr_turnstile.c +++ b/sys/kern/subr_turnstile.c @@ -53,6 +53,12 @@ #include "opt_ddb.h" #include "opt_witness.h" +/* + * Cause non-inlined mtx_*() to be compiled. + * Must be defined early because other system headers may include mutex.h. + */ +#define _KERN_MUTEX_C_ + #include #include #include @@ -73,7 +79,6 @@ #include #include -#define _KERN_MUTEX_C_ /* Cause non-inlined mtx_*() to be compiled. */ #include /* diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c index bc335c558a5f..e66e6f8e36fd 100644 --- a/sys/kern/subr_witness.c +++ b/sys/kern/subr_witness.c @@ -53,6 +53,12 @@ #include "opt_ddb.h" #include "opt_witness.h" +/* + * Cause non-inlined mtx_*() to be compiled. + * Must be defined early because other system headers may include mutex.h. + */ +#define _KERN_MUTEX_C_ + #include #include #include @@ -73,7 +79,6 @@ #include #include -#define _KERN_MUTEX_C_ /* Cause non-inlined mtx_*() to be compiled. */ #include /*