diff lib/alloca.in.h @ 40229:6abc91ece034

alloca-opt: Fix conflict mingw's new <alloca.h> file. Reported by Eli Zaretskii <eliz@gnu.org>. * lib/alloca.in.h: On mingw systems that have <alloca.h>, include that. * m4/alloca.m4 (gl_FUNC_ALLOCA): Set HAVE_ALLOCA_H. * modules/alloca-opt (Makefile.am): Substitute HAVE_ALLOCA_H.
author Bruno Haible <bruno@clisp.org>
date Sun, 10 Mar 2019 20:39:34 +0100
parents b06060465f09
children
line wrap: on
line diff
--- 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 <alloca.h> that causes trouble when
+      included after 'alloca' gets defined as a macro.  As a workaround, include
+      this <alloca.h> first and define 'alloca' as a macro afterwards.  */
+#  if (defined _WIN32 && ! defined __CYGWIN__) && @HAVE_ALLOCA_H@
+#   include_next <alloca.h>
+#  endif
 #  define alloca __builtin_alloca
 # elif defined _AIX
 #  define alloca __alloca