diff options
author | Bruno Haible <bruno@clisp.org> | 2020-06-30 00:54:54 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2020-06-30 00:54:54 +0200 |
commit | 160672dd02c56f0feffc250acd3bf241418b849b (patch) | |
tree | 7ff312e619e515b08e855e617c469c9ad412cf92 /lib/alloca.in.h | |
parent | a01be1645717a029e571fd0dbb42245f05aff88c (diff) | |
download | gnulib-160672dd02c56f0feffc250acd3bf241418b849b.tar.gz |
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.
Diffstat (limited to 'lib/alloca.in.h')
-rw-r--r-- | lib/alloca.in.h | 15 |
1 files changed, 9 insertions, 6 deletions
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 @@ -35,13 +35,16 @@ */ #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 |