# HG changeset patch # User Bruno Haible # Date 1552246774 -3600 # Node ID 6abc91ece0344c3273f61fa8a8c562704980cf27 # Parent bb9e295185c828b4797476d9ddc5fcbf5f5c67bd alloca-opt: Fix conflict mingw's new file. Reported by Eli Zaretskii . * lib/alloca.in.h: On mingw systems that have , include that. * m4/alloca.m4 (gl_FUNC_ALLOCA): Set HAVE_ALLOCA_H. * modules/alloca-opt (Makefile.am): Substitute HAVE_ALLOCA_H. diff -r bb9e295185c8 -r 6abc91ece034 ChangeLog --- a/ChangeLog Sun Mar 10 10:11:53 2019 -0700 +++ b/ChangeLog Sun Mar 10 20:39:34 2019 +0100 @@ -1,3 +1,11 @@ +2019-03-10 Bruno Haible + + alloca-opt: Fix conflict mingw's new file. + Reported by Eli Zaretskii . + * lib/alloca.in.h: On mingw systems that have , include that. + * m4/alloca.m4 (gl_FUNC_ALLOCA): Set HAVE_ALLOCA_H. + * modules/alloca-opt (Makefile.am): Substitute HAVE_ALLOCA_H. + 2019-03-10 Bruno Haible tests: Avoid havoc with "gcc -fcheck-pointer-bounds". diff -r bb9e295185c8 -r 6abc91ece034 lib/alloca.in.h --- a/lib/alloca.in.h Sun Mar 10 10:11:53 2019 -0700 +++ b/lib/alloca.in.h Sun Mar 10 20:39:34 2019 +0100 @@ -36,6 +36,12 @@ #ifndef alloca # ifdef __GNUC__ + /* Some version of mingw have an that causes trouble when + included after 'alloca' gets defined as a macro. As a workaround, include + this first and define 'alloca' as a macro afterwards. */ +# if (defined _WIN32 && ! defined __CYGWIN__) && @HAVE_ALLOCA_H@ +# include_next +# endif # define alloca __builtin_alloca # elif defined _AIX # define alloca __alloca diff -r bb9e295185c8 -r 6abc91ece034 m4/alloca.m4 --- a/m4/alloca.m4 Sun Mar 10 10:11:53 2019 -0700 +++ b/m4/alloca.m4 Sun Mar 10 20:39:34 2019 +0100 @@ -1,4 +1,4 @@ -# alloca.m4 serial 14 +# alloca.m4 serial 15 dnl Copyright (C) 2002-2004, 2006-2007, 2009-2019 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation @@ -37,6 +37,13 @@ fi AC_SUBST([ALLOCA_H]) AM_CONDITIONAL([GL_GENERATE_ALLOCA_H], [test -n "$ALLOCA_H"]) + + if test $ac_cv_working_alloca_h = yes; then + HAVE_ALLOCA_H=1 + else + HAVE_ALLOCA_H=0 + fi + AC_SUBST([HAVE_ALLOCA_H]) ]) # Prerequisites of lib/alloca.c. diff -r bb9e295185c8 -r 6abc91ece034 modules/alloca-opt --- a/modules/alloca-opt Sun Mar 10 10:11:53 2019 -0700 +++ b/modules/alloca-opt Sun Mar 10 20:39:34 2019 +0100 @@ -21,7 +21,7 @@ alloca.h: alloca.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - cat $(srcdir)/alloca.in.h; \ + sed -e 's|@''HAVE_ALLOCA_H''@|$(HAVE_ALLOCA_H)|g' < $(srcdir)/alloca.in.h; \ } > $@-t && \ mv -f $@-t $@ else