From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1921) id BFE30385022A; Fri, 24 Jun 2022 05:43:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BFE30385022A Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Sebastian Huber To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] sys/_bitset.h: Fix fall-out from commit 5e04571cf3c X-Act-Checkin: newlib-cygwin X-Git-Author: =?utf-8?q?Stefan_E=C3=9Fer?= X-Git-Refname: refs/heads/master X-Git-Oldrev: 2f6651097e7c2bf6323745ff332cc8e9df0564b2 X-Git-Newrev: c78c56c06dad8a9fe51382366266a5700614f2e9 Message-Id: <20220624054329.BFE30385022A@sourceware.org> Date: Fri, 24 Jun 2022 05:43:29 +0000 (GMT) X-BeenThere: newlib-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib GIT logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2022 05:43:29 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Dc78c56c06da= d8a9fe51382366266a5700614f2e9 commit c78c56c06dad8a9fe51382366266a5700614f2e9 Author: Stefan E=C3=9Fer Date: Tue Dec 7 20:29:26 2021 +0100 sys/_bitset.h: Fix fall-out from commit 5e04571cf3c =20 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). =20 This commit moved the declaration of __BITSET_ALLOC into the conditional block that depends on _KERNEL or _WANT_FREEBSD_BITSET being defined. =20 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. =20 This patch has been tested by building lang/gcc11 and a successful make buildworld. =20 This commit shall be MFCed together with commit 5e04571cf3c. =20 MFC after: 1 month Diff: --- newlib/libc/sys/rtems/include/sys/bitset.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/newlib/libc/sys/rtems/include/sys/bitset.h b/newlib/libc/sys/r= tems/include/sys/bitset.h index 00bdc23f9..c9448a73a 100644 --- a/newlib/libc/sys/rtems/include/sys/bitset.h +++ b/newlib/libc/sys/rtems/include/sys/bitset.h @@ -311,12 +311,12 @@ =20 #define __BITSET_SIZE(_s) (__bitset_words((_s)) * sizeof(long)) =20 +#if defined(_KERNEL) || defined(_WANT_FREEBSD_BITSET) /* * Dynamically allocate a bitset. */ #define __BITSET_ALLOC(_s, mt, mf) malloc(__BITSET_SIZE((_s)), mt, (mf)) =20 -#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) @@ -358,6 +358,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) */ =20 #endif /* !_SYS_BITSET_H_ */