aboutsummaryrefslogtreecommitdiff
path: root/gdbsupport
diff options
context:
space:
mode:
authorKamil Rytarowski <n54@gmx.com>2020-03-17 15:01:55 +0100
committerKamil Rytarowski <n54@gmx.com>2020-03-18 02:29:21 +0100
commitd3e2a5e85df4c8454135503c1034b95fecd522ab (patch)
tree4af771c22c6814d975977baf06bebf15644ef73a /gdbsupport
parent5ccd2fb722d1900adf799dd808fa2146cac85d0d (diff)
downloadgdb-d3e2a5e85df4c8454135503c1034b95fecd522ab.zip
gdb-d3e2a5e85df4c8454135503c1034b95fecd522ab.tar.gz
gdb-d3e2a5e85df4c8454135503c1034b95fecd522ab.tar.bz2
Include <alloca.h> conditionally
Fixes build on NetBSD, where alloca() is defined in <stdlib.h>. gdbsupport: * common-defs.h: Include alloca.h if HAVE_ALLOCA_H is defined.
Diffstat (limited to 'gdbsupport')
-rw-r--r--gdbsupport/ChangeLog4
-rw-r--r--gdbsupport/common-defs.h2
2 files changed, 6 insertions, 0 deletions
diff --git a/gdbsupport/ChangeLog b/gdbsupport/ChangeLog
index c471726..f62e440 100644
--- a/gdbsupport/ChangeLog
+++ b/gdbsupport/ChangeLog
@@ -1,3 +1,7 @@
+2020-03-17 Kamil Rytarowski <n54@gmx.com>
+
+ * common-defs.h: Include alloca.h if HAVE_ALLOCA_H is defined.
+
2020-03-12 Tom Tromey <tom@tromey.com>
* common-types.h: Remove GDBSERVER code.
diff --git a/gdbsupport/common-defs.h b/gdbsupport/common-defs.h
index 65500ce..e42d2b8 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