diff options
-rw-r--r-- | NEWS | 13 | ||||
-rw-r--r-- | lib/autoconf/headers.m4 | 6 | ||||
-rw-r--r-- | tests/local.at | 4 |
3 files changed, 19 insertions, 4 deletions
@@ -39,6 +39,19 @@ GNU Autoconf NEWS - User visible changes. represent cache file timestamps, thus avoiding some problems where automake incorrectly decides not to regenerate stale caches. +*** AC_HEADER_STDBOOL and AC_CHECK_HEADER_STDBOOL are less picky. + + When compiling C++, a ‘stdbool.h’ that exists, but does nothing, is + acceptable no matter what version of the C++ standard is in use. + + (ISO C++ 2011 says that ‘stdbool.h’ should exist for compatibility + with C, but should *not* define ‘bool’, ‘true’, or ‘false’ as + macros. ISO C++ 1998 doesn’t mention ‘stdbool.h’ at all. Some C++ + compilers implement the 2011 rule in their C++98 mode as well. + ‘bool’, ‘true’, and ‘false’ have been built into the C++ language + since the beginning, so a ‘stdbool.h’ that exists but does nothing + should be fine for all reasonable C++ programs.) + * Noteworthy changes in release 2.71 (2021-01-28) [stable] ** Bug fixes, including: diff --git a/lib/autoconf/headers.m4 b/lib/autoconf/headers.m4 index 8944da41..5cd1f4d5 100644 --- a/lib/autoconf/headers.m4 +++ b/lib/autoconf/headers.m4 @@ -633,8 +633,10 @@ AC_DEFUN([AC_CHECK_HEADER_STDBOOL], bool *pp = &p; /* C 1999 specifies that bool, true, and false are to be - macros, but C++ 2011 and later overrule this. */ - #if __cplusplus < 201103 + macros, but C++ 2011 overrules this. The C++ committee + was codifying existing practice, so we allow them to + not be macros whenever __cplusplus is defined. */ + #ifndef __cplusplus #ifndef bool #error "bool is not defined" #endif diff --git a/tests/local.at b/tests/local.at index 3f348929..f79f57ff 100644 --- a/tests/local.at +++ b/tests/local.at @@ -593,9 +593,9 @@ AT_CMP([at_defines-$1], [at_defines-$2])[]dnl m4_define([_AT_DEFINES_CMP_PRUNE], [m4_bmatch([$1], [^vary:], -[ /@%:@define ]m4_bpatsubsts([$1], [\<vary:], [])dnl +[ /@%:@define ]m4_bpatsubsts([$1], [\<vary:], [])[]dnl [@<:@ @{:@@:>@/ d ;@%:@@:}@ - /@%:@undef ]m4_bpatsubsts([$1], [\<vary:], [])dnl + /@%:@undef ]m4_bpatsubsts([$1], [\<vary:], [])[]dnl [@<:@ @{:@@:>@/ d ;@%:@@:}@ ], [m4_fatal([unrecognized AT_DEFINES_CMP variance token: "$1"])])]) |