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.
This commit is contained in:
Warner Losh 2020-09-25 19:02:49 +00:00
parent e62e4b8594
commit fcefa24551
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=366168

View File

@ -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.
*/