From: Joseph Myers Date: Wed, 19 Aug 2020 22:46:41 +0000 (+0000) Subject: Add C2x BOOL_MAX and BOOL_WIDTH to limits.h. X-Git-Tag: glibc-2.33~562 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e5baabf57b1f6bcaf60068b3fd24af649e4e91c6;p=thirdparty%2Fglibc.git 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 --git a/include/limits.h b/include/limits.h index 8195da78a4a..29e9b943b94 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