Date: Fri, 25 Sep 2020 19:02:50 +0000 (UTC) From: Warner Losh <imp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366168 - head/sys/sys Message-ID: <202009251902.08PJ2oBE029117@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: imp Date: Fri Sep 25 19:02:49 2020 New Revision: 366168 URL: https://svnweb.freebsd.org/changeset/base/366168 Log: Dont let kernel and standalone both be defined at the same time _KERNEL and _STANDALONE are different things. They cannot both be true at the same time. If things that are normally visible only to _KERNEL are needed for the _STANDALONE environment, you need to also make them visible to _STANDALONE. Often times, this will be just a subset of the required things for _KERNEL (eg global variables are but one example). sys/cdefs.h is included by pretty much everything in both the loader and the kernel, so is the ideal choke point. Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Fri Sep 25 18:55:50 2020 (r366167) +++ head/sys/sys/cdefs.h Fri Sep 25 19:02:49 2020 (r366168) @@ -38,6 +38,10 @@ #ifndef _SYS_CDEFS_H_ #define _SYS_CDEFS_H_ +#if defined(_KERNEL) && defined(_STANDALONE) +#error "_KERNEL and _STANDALONE are mutually exclusive" +#endif + /* * Testing against Clang-specific extensions. */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202009251902.08PJ2oBE029117>