]> Savannah Git Hosting - gnulib.git/commitdiff
alloca-opt: Fix warning on mingw.
authorBruno Haible <bruno@clisp.org>
Mon, 29 Jun 2020 22:54:54 +0000 (00:54 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 29 Jun 2020 22:54:54 +0000 (00:54 +0200)
Reported and solution by Eli Zaretskii <eliz@gnu.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-06/msg00069.html>.

* lib/alloca.in.h: On mingw, include <alloca.h> and then test again
whether alloca is defined.

ChangeLog
lib/alloca.in.h

index c6e26120eaac5e61fb39ea1f8550de8997dd7733..e0b5ace41b8c7231acbb977e815a374fa93d427e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2020-06-29  Bruno Haible  <bruno@clisp.org>
+
+       alloca-opt: Fix warning on mingw.
+       Reported and solution by Eli Zaretskii <eliz@gnu.org> in
+       <https://lists.gnu.org/archive/html/bug-gnulib/2020-06/msg00069.html>.
+       * lib/alloca.in.h: On mingw, include <alloca.h> and then test again
+       whether alloca is defined.
+
 2020-06-28  Paul Eggert  <eggert@cs.ucla.edu>
 
        getrandom: do not depend on ‘open’ on mingw
index 73516ca3fba5b9d3a8d01fff5adea4ac7cf88f36..beb022cf65fe22ed1ecdd5f26d99c4ce5e4e82d0 100644 (file)
        request, the program just crashes.
  */
 
+#ifndef alloca
+  /* 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 needed.  */
+# if defined __GNUC__ && (defined _WIN32 && ! defined __CYGWIN__) && @HAVE_ALLOCA_H@
+#  include_next <alloca.h>
+# endif
+#endif
 #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