svn commit: r365734 - head/sys/sys

Warner Losh imp at FreeBSD.org
Mon Sep 14 23:27:51 UTC 2020


Author: imp
Date: Mon Sep 14 23:27:51 2020
New Revision: 365734
URL: https://svnweb.freebsd.org/changeset/base/365734

Log:
  Tweak what's visible in the standalone environment. We define offsetof
  in stand.h typically, but when this is included we can define it
  multiple times. However, we don't define bool in stand.h at the
  moment, so allow it to be defined inside types.h when we're building
  for the standalone environment.
  
  MFC After: 3 days

Modified:
  head/sys/sys/types.h

Modified: head/sys/sys/types.h
==============================================================================
--- head/sys/sys/types.h	Mon Sep 14 22:42:17 2020	(r365733)
+++ head/sys/sys/types.h	Mon Sep 14 23:27:51 2020	(r365734)
@@ -292,6 +292,10 @@ typedef	__uint64_t	uoff_t;
 typedef	char		vm_memattr_t;	/* memory attribute codes */
 typedef	struct vm_page	*vm_page_t;
 
+#define offsetof(type, field) __offsetof(type, field)
+#endif /* _KERNEL */
+
+#if	defined(_KERNEL) || defined(_STANDALONE)
 #if !defined(__bool_true_false_are_defined) && !defined(__cplusplus)
 #define	__bool_true_false_are_defined	1
 #define	false	0
@@ -301,10 +305,7 @@ typedef	int	_Bool;
 #endif
 typedef	_Bool	bool;
 #endif /* !__bool_true_false_are_defined && !__cplusplus */
-
-#define offsetof(type, field) __offsetof(type, field)
-
-#endif /* _KERNEL */
+#endif /* KERNEL || _STANDALONE */
 
 /*
  * The following are all things that really shouldn't exist in this header,


More information about the svn-src-head mailing list