]> Savannah Git Hosting - gnulib.git/commit
stdio: fix probe on mingw under gcc 5.1
authorEric Blake <eblake@redhat.com>
Wed, 20 May 2015 23:18:20 +0000 (17:18 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 26 May 2015 20:58:24 +0000 (14:58 -0600)
commit21431dee118d5833e8a7dda71e527c3116fd9d5f
tree9d4dd9427d8c7fbfc915462bbb1f74d830384c24
parent875ec93e1501d2d2a8bab1b64fa66b8ceb51dc67
stdio: fix probe on mingw under gcc 5.1

Per https://gcc.gnu.org/gcc-5/porting_to.html, gcc 5.1 intentionally
changed the preprocessor to emit multiple lines, rather than one
line, when expanding text that includes literal markers combined with
a macro expansion obtained from a header.  This in turn breaks the
probe for whether mingw headers support GNU-style "lld" for PRIdMAX,
as the probe text was no longer on one line.

This patch changes from grepping preprocessor output (with its
indeterminate layout due to differences in preprocessors) to instead
using a compile-time check of the length of the macro expansion.

It feels a bit gross, but the grossness is limited to mingw, which
is the only platform where using __gnu_printf__ instead of __printf__
will make a difference.

Based on a report by Suren Hajyan.

* m4/stdio_h.m4 (gl_STDIO_H): Change to compile test, to work
around new gcc preprocessor rules.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
m4/stdio_h.m4