*** AC_DEFINE_UNQUOTED no longer mishandles double-quotes inside $(...)
and ${...}.
+*** AC_DEFINE and similar macros no longer emit trailing whitespace.
+ This pacifies the -Wtrailing-whitespace introduced in GCC 15.
+
*** AC_FUNC_STRNLEN now detects Android 5.0's broken strnlen.
*** AC_PROG_OBJC now finds the GNU Objective-C compiler, as packaged in
macro = mac2[1]
prefix = substr(line, 1, index(line, defundef) - 1)
if (D_is_set[macro]) {
+ suffix = P[macro] D[macro]
+ while (suffix ~ /[\t ]$/) {
+ suffix = substr(suffix, 1, length(suffix) - 1)
+ }
# Preserve the white space surrounding the "#".
- print prefix "define", macro P[macro] D[macro]
+ print prefix "define", macro suffix
next
} else {
# Replace #undef with comments. This is necessary, for example,
done
AT_CLEANUP
+## ---------------------------------------------- ##
+## No trailing white space in macro definitions. ##
+## ---------------------------------------------- ##
+AT_SETUP([No trailing white space in macro definitions])
+AT_KEYWORDS([AC@&t@_DEFINE AC@&t@_DEFINE_UNQUOTED])
+
+AT_DATA([config.hin], [
+#undef EMPTY
+#undef SPACE
+#undef TAB
+#undef LEADING_SPACES
+#undef LEADING_TABS
+])
+
+AT_DATA([configure.ac],
+[[AC_INIT
+AC_CONFIG_HEADERS([config.h:config.hin])
+empty=
+space=' '
+tab=' '
+leading_spaces=' a'
+leading_tabs=' a'
+AC_DEFINE_UNQUOTED([EMPTY], [$empty], [empty])
+AC_DEFINE_UNQUOTED([SPACE], [$space], [space])
+AC_DEFINE_UNQUOTED([TAB], [$tab], [tab])
+AC_DEFINE_UNQUOTED([LEADING_SPACES], [$leading_spaces], [leading spaces])
+AC_DEFINE_UNQUOTED([LEADING_TABS], [$leading_tabs], [leading tabs])
+AC_OUTPUT
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE
+
+AT_DATA([expout],
+[[/* config.h. Generated from config.hin by configure. */
+
+#define EMPTY
+#define SPACE
+#define TAB
+#define LEADING_SPACES a
+#define LEADING_TABS a
+]])
+AT_CHECK([cat config.h], 0, expout)
+
+AT_CLEANUP
## ---------------------- ##
## Substitute a newline. ##