sys/_bitset.h: Fix fall-out from commit 5e04571cf3
There is a reference to malloc() in #define __BITSET_ALLOC. Even
though this macro is only defined but not used, it causes the lang/gcc
ports to fail. The gcc ports "poison" a number of functions including
malloc() and prevent their use (including in macro definitions).
This commit moved the declaration of __BITSET_ALLOC into the
conditional block that depends on _KERNEL or _WANT_FREEBSD_BITSET
being defined.
There is no use of __BITSET_ALLOC in the FreeBSD sources, and userland
programs that want to use BITSEC_ALLOC will define _WANT_FREEBSD_BITSET
anyway.
This patch has been tested by building lang/gcc11 and a successful
make buildworld.
This commit shall be MFCed together with commit 5e04571cf3
.
MFC after: 1 month
This commit is contained in:
parent
74e014dbfa
commit
22c4ab6cb0
@ -308,12 +308,12 @@
|
||||
|
||||
#define __BITSET_SIZE(_s) (__bitset_words((_s)) * sizeof(long))
|
||||
|
||||
#if defined(_KERNEL) || defined(_WANT_FREEBSD_BITSET)
|
||||
/*
|
||||
* Dynamically allocate a bitset.
|
||||
*/
|
||||
#define __BITSET_ALLOC(_s, mt, mf) malloc(__BITSET_SIZE((_s)), mt, (mf))
|
||||
|
||||
#if defined(_KERNEL) || defined(_WANT_FREEBSD_BITSET)
|
||||
#define BIT_AND(_s, d, s) __BIT_AND(_s, d, s)
|
||||
#define BIT_AND2(_s, d, s1, s2) __BIT_AND2(_s, d, s1, s2)
|
||||
#define BIT_ANDNOT(_s, d, s) __BIT_ANDNOT(_s, d, s)
|
||||
@ -355,6 +355,6 @@
|
||||
#define BITSET_FSET(n) __BITSET_FSET(n)
|
||||
#define BITSET_SIZE(_s) __BITSET_SIZE(_s)
|
||||
#define BITSET_T_INITIALIZER(x) __BITSET_T_INITIALIZER(x)
|
||||
#endif
|
||||
#endif /* defined(_KERNEL) || defined(_WANT_FREEBSD_BITSET) */
|
||||
|
||||
#endif /* !_SYS_BITSET_H_ */
|
||||
|
Loading…
Reference in New Issue
Block a user