This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] sim: make sure to include strsignal prototype
- From: Mike Frysinger <vapier at gentoo dot org>
- To: gdb-patches at sourceware dot org
- Date: Fri, 23 Mar 2012 00:23:12 -0400
- Subject: [PATCH] sim: make sure to include strsignal prototype
Before POSIX standardized strsignal(), old systems would hide the
prototype unless the normal extension defines were enabled. So use
the AC_USE_SYSTEM_EXTENSIONS helper for that.
Then make sure we include string.h ourselves in nrun.c rather than
relying on implicit includes via other sim headers.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
sim/common/:
2012-03-23 Mike Frysinger <vapier@gentoo.org>
* acinclude.m4 (SIM_AC_COMMON): Call AC_USE_SYSTEM_EXTENSIONS.
* nrun.c: Include string.h/strings.h.
* aclocal.m4, config.in, configure: Regenerate.
sim/arm:
sim/bfin:
sim/avr:
sim/d10v:
sim/cr16:
sim/cris:
sim/erc32:
sim/frv:
sim/h8300:
sim/iq2000:
sim/m32c:
sim/m32r:
sim/lm32:
sim/m68hc11:
sim/microblaze:
sim/mcore:
sim/mips:
sim/mn10300:
sim/moxie:
sim/rl78:
sim/rx:
sim/sh64:
sim/sh:
sim/v850:
2012-03-23 Mike Frysinger <vapier@gentoo.org>
* aclocal.m4, config.in, configure: Regenerate.
sim/igen:
sim/ppc:
sim/testsuite:
2012-03-23 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.
---
sim/common/acinclude.m4 | 1 +
sim/common/nrun.c | 10 ++++++++++
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/sim/common/acinclude.m4 b/sim/common/acinclude.m4
index 2833d8e..ef42775 100644
--- a/sim/common/acinclude.m4
+++ b/sim/common/acinclude.m4
@@ -29,6 +29,7 @@ AC_REQUIRE([AC_PROG_CC])
# autoconf.info says this should be called right after AC_INIT.
AC_CONFIG_HEADER(ifelse([$1],,config.h,[$1]):config.in)
AC_CANONICAL_SYSTEM
+AC_USE_SYSTEM_EXTENSIONS
AC_ARG_PROGRAM
AC_PROG_INSTALL
diff --git a/sim/common/nrun.c b/sim/common/nrun.c
index a50ae06..8e92879 100644
--- a/sim/common/nrun.c
+++ b/sim/common/nrun.c
@@ -15,6 +15,16 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <signal.h>
+
+/* For strsignal. */
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+
#include "sim-main.h"
#include "bfd.h"
--
1.7.8.5