diff options
author | Stefan Eßer <se@FreeBSD.org> | 2021-12-08 08:47:42 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2022-06-22 10:15:26 +0200 |
commit | 6af6e295529bb2ba9941e7f3d7938799a668e5f6 (patch) | |
tree | 03ebe1a3ac79fb87b04b1f7a68a25fb39cf0b2c5 /newlib/libc/sys | |
parent | 3af17aef2b0391a9b58f03f7e37e14aed4f9cdfd (diff) | |
download | newlib-6af6e295529bb2ba9941e7f3d7938799a668e5f6.zip newlib-6af6e295529bb2ba9941e7f3d7938799a668e5f6.tar.gz newlib-6af6e295529bb2ba9941e7f3d7938799a668e5f6.tar.bz2 |
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
Diffstat (limited to 'newlib/libc/sys')
-rw-r--r-- | newlib/libc/sys/rtems/include/sys/_bitset.h | 7 |
1 files changed, 4 insertions, 3 deletions
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_ */ |