From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1105) id DF9753857C5A; Wed, 19 Aug 2020 22:46:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DF9753857C5A Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Joseph Myers To: glibc-cvs@sourceware.org Subject: [glibc] Add C2x BOOL_MAX and BOOL_WIDTH to limits.h. X-Act-Checkin: glibc X-Git-Author: Joseph Myers X-Git-Refname: refs/heads/master X-Git-Oldrev: c08df688f2480b7e9c2723c24cd0cf1551ac283c X-Git-Newrev: e5baabf57b1f6bcaf60068b3fd24af649e4e91c6 Message-Id: <20200819224657.DF9753857C5A@sourceware.org> Date: Wed, 19 Aug 2020 22:46:57 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2020 22:46:58 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e5baabf57b1f6bcaf60068b3fd24af649e4e91c6 commit e5baabf57b1f6bcaf60068b3fd24af649e4e91c6 Author: Joseph Myers Date: Wed Aug 19 22:46:41 2020 +0000 Add C2x BOOL_MAX and BOOL_WIDTH to limits.h. C2x adds BOOL_MAX and BOOL_WIDTH macros to . This patch adds them to glibc's for the case when they aren't defined by GCC's . Tested for x86_64. Diff: --- include/limits.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/limits.h b/include/limits.h index 8195da78a4..29e9b943b9 100644 --- a/include/limits.h +++ b/include/limits.h @@ -178,6 +178,18 @@ # endif #endif /* Use IEC_60559_BFP_EXT. */ +/* The macros for _Bool are not defined by GCC's before GCC + 11, or if _GNU_SOURCE is defined rather than enabling C2x support + with -std. */ +#if __GLIBC_USE (ISOC2X) +# ifndef BOOL_MAX +# define BOOL_MAX 1 +# endif +# ifndef BOOL_WIDTH +# define BOOL_WIDTH 1 +# endif +#endif + #ifdef __USE_POSIX /* POSIX adds things to . */ # include