* [PATCH] Include <alloca.h> conditionally
@ 2020-03-17 14:03 Kamil Rytarowski
2020-03-18 1:20 ` Simon Marchi
0 siblings, 1 reply; 2+ messages in thread
From: Kamil Rytarowski @ 2020-03-17 14:03 UTC (permalink / raw)
To: gdb-patches
Fixes build on NetBSD, where alloca() is defined in <stdlib.h>.
---
gdbsupport/common-defs.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gdbsupport/common-defs.h b/gdbsupport/common-defs.h
index 65500ce7634..e42d2b80c04 100644
--- a/gdbsupport/common-defs.h
+++ b/gdbsupport/common-defs.h
@@ -92,7 +92,9 @@
#include <strings.h> /* for strcasecmp and strncasecmp */
#endif
#include <errno.h>
+#if HAVE_ALLOCA_H
#include <alloca.h>
+#endif
#include "ansidecl.h"
/* This is defined by ansidecl.h, but we prefer gnulib's version. On
--
2.25.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Include <alloca.h> conditionally
2020-03-17 14:03 [PATCH] Include <alloca.h> conditionally Kamil Rytarowski
@ 2020-03-18 1:20 ` Simon Marchi
0 siblings, 0 replies; 2+ messages in thread
From: Simon Marchi @ 2020-03-18 1:20 UTC (permalink / raw)
To: Kamil Rytarowski, gdb-patches
On 2020-03-17 10:03 a.m., Kamil Rytarowski wrote:
> Fixes build on NetBSD, where alloca() is defined in <stdlib.h>.
> ---
> gdbsupport/common-defs.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/gdbsupport/common-defs.h b/gdbsupport/common-defs.h
> index 65500ce7634..e42d2b80c04 100644
> --- a/gdbsupport/common-defs.h
> +++ b/gdbsupport/common-defs.h
> @@ -92,7 +92,9 @@
> #include <strings.h> /* for strcasecmp and strncasecmp */
> #endif
> #include <errno.h>
> +#if HAVE_ALLOCA_H
> #include <alloca.h>
> +#endif
>
> #include "ansidecl.h"
> /* This is defined by ansidecl.h, but we prefer gnulib's version. On
> --
> 2.25.0
>
This is ok, please don't forget the ChangeLog entry.
Simon
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-03-18 1:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-17 14:03 [PATCH] Include <alloca.h> conditionally Kamil Rytarowski
2020-03-18 1:20 ` Simon Marchi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).