From 6af6e295529bb2ba9941e7f3d7938799a668e5f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20E=C3=9Fer?= Date: Wed, 8 Dec 2021 08:47:42 +0100 Subject: sys/_bitset.h: Fix fall-out from commit 5e04571cf3c The changes to the bitset macros allowed sched.h to be included into userland programs without name space pollution due to BIT_* and BITSET_* macros. The definition of a "struct bitset" had been overlooked. This name space pollution caused the build of port print/miktex to fail. This commit makes the definition of struct bitset depend on the same condition as the visibility of the BIT_* and BITSET_* macros, i.e. needs _KERNEL or _WANT_FREEBSD_BITSET to be defined before including sys/_bitset.h. It has been tested with "make universe" since a prior attempt to fix the issue broke the PowerPC64 kernel build. This commit shall be MFCed together with commit 5e04571cf3c. Reported by: arrowd MFC after: 1 month --- newlib/libc/sys/rtems/include/sys/_bitset.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'newlib/libc/sys') diff --git a/newlib/libc/sys/rtems/include/sys/_bitset.h b/newlib/libc/sys/rtems/include/sys/_bitset.h index 1c167da..70b9713 100644 --- a/newlib/libc/sys/rtems/include/sys/_bitset.h +++ b/newlib/libc/sys/rtems/include/sys/_bitset.h @@ -52,7 +52,7 @@ struct _t { \ /* * Helper to declare a bitset without it's size being a constant. * - * Sadly we cannot declare a bitset struct with '__bits[]', because it's + * Sadly we cannot declare a bitset struct with 'bits[]', because it's * the only member of the struct and the compiler complains. */ #define __BITSET_DEFINE_VAR(_t) __BITSET_DEFINE(_t, 1) @@ -61,11 +61,12 @@ struct _t { \ * Define a default type that can be used while manually specifying size * to every call. */ -__BITSET_DEFINE(bitset, 1); #if defined(_KERNEL) || defined(_WANT_FREEBSD_BITSET) +__BITSET_DEFINE(bitset, 1); + #define BITSET_DEFINE(_t, _s) __BITSET_DEFINE(_t, _s) #define BITSET_DEFINE_VAR(_t) __BITSET_DEFINE_VAR(_t) -#endif +#endif /* defined(_KERNEL) || defined(_WANT_FREEBSD_BITSET) */ #endif /* !_SYS__BITSET_H_ */ -- cgit v1.1