This reverts to Autoconf 2.69 behavior, and also fixes a bug where
AC_PROG_CXX rejected C++20 compilers.
+** New features
+
+*** Programs now recognize #elifdef and #elifndef.
+ The autom4te, autoscan and ifnames programs now recognize the two
+ preprocessor directives, which were introduced in C23 and C++23.
+
* Noteworthy changes in release 2.72 (2023-12-22) [release]
** Backward incompatibilities
# Don't complain in comments. Well, until we have something
# better, don't consider '#include' etc. are comments.
s/\#.*//
- unless /^\#\s*(if|include|endif|ifdef|ifndef|define)\b/;
+ unless /^\#\s*(include|endif|(el)?if(n?def)?|define)\b/;
foreach (split (/\W+/))
{
$prohibited{$_} = $.
# Don't complain in comments. Well, until we have something
# better, don't consider '#include' etc. to be comments.
s/\#.*//
- unless /^\#(if|include|endif|ifdef|ifndef|define)\b/;
+ unless /^\#(include|endif|(el)?if(n?def)?|define)\b/;
# Complain once per word, but possibly several times per line.
while (/$prohibited/)
{
used ('header', $1);
}
- if (s/^(if|ifdef|ifndef|elif)\s+//)
+ if (s/^(el)?if(n?def)?\s+//)
{
foreach my $word (split (/\W+/))
{
Scan all of the C source FILES (or the standard input, if none are
given) and write to the standard output a sorted list of all the
-identifiers that appear in those files in '#if', '#elif', '#ifdef', or
-'#ifndef' directives. Print each identifier on a line, followed by a
-space-separated list of the files in which that identifier occurs.
+identifiers that appear in those files in '#if', '#ifdef', '#ifndef',
+'#elif', '#elifdef', or '#elifndef' directives. Print each identifier
+on a line, followed by a space-separated list of the files in which
+that identifier occurs.
-h, --help print this help, then exit
-V, --version print version number, then exit
while (s/\\$//);
# Preprocessor directives.
- if (s/^\s*\#\s*(if|ifdef|ifndef|elif)\s+//)
+ if (s/^\s*\#\s*(el)?if(n?def)?\s+//)
{
# Remove comments. Not perfect, but close enough.
s(/\*.*?\*/)();
@command{ifnames} scans all of the C source files named on the command line
(or the standard input, if none are given) and writes to the standard
output a sorted list of all the identifiers that appear in those files
-in @code{#if}, @code{#elif}, @code{#ifdef}, or @code{#ifndef}
-directives. It prints each identifier on a line, followed by a
+in @code{#if}, @code{#ifdef}, @code{#ifndef}, @code{#elif},
+@code{#elifdef}, or @code{#elifndef} directives.
+It prints each identifier on a line, followed by a
space-separated list of the files in which that identifier occurs.
@noindent
AT_DATA([iftest2.c],
[[#ifdef IFTEST2
+#elifdef IFTEST3
+#elifndef IFTEST4
#if VAL1
]])
DEF3 iftest1.c
DEF4 iftest1.c
IFTEST2 iftest2.c
+IFTEST3 iftest2.c
+IFTEST4 iftest2.c
LINE1 iftest1.c
LINE2 iftest1.c
SPACES iftest1.c