From 160672dd02c56f0feffc250acd3bf241418b849b Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 30 Jun 2020 00:54:54 +0200 Subject: [PATCH] alloca-opt: Fix warning on mingw. Reported and solution by Eli Zaretskii in . * lib/alloca.in.h: On mingw, include and then test again whether alloca is defined. --- ChangeLog | 8 ++++++++ lib/alloca.in.h | 15 +++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index c6e26120ea..e0b5ace41b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2020-06-29 Bruno Haible + + alloca-opt: Fix warning on mingw. + Reported and solution by Eli Zaretskii in + . + * lib/alloca.in.h: On mingw, include and then test again + whether alloca is defined. + 2020-06-28 Paul Eggert getrandom: do not depend on ‘open’ on mingw diff --git a/lib/alloca.in.h b/lib/alloca.in.h index 73516ca3fb..beb022cf65 100644 --- a/lib/alloca.in.h +++ b/lib/alloca.in.h @@ -34,14 +34,17 @@ request, the program just crashes. */ +#ifndef alloca + /* 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 needed. */ +# if defined __GNUC__ && (defined _WIN32 && ! defined __CYGWIN__) && @HAVE_ALLOCA_H@ +# include_next +# endif +#endif #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 -- 2.39.5