aboutsummaryrefslogtreecommitdiff
path: root/sim/ppc
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2023-12-04 23:32:51 -0500
committerMike Frysinger <vapier@gentoo.org>2023-12-04 23:36:20 -0500
commita3d3d9a7d9e0d5bf6168180f4f1b68ed37968f94 (patch)
tree6c55138b528e340f8d4297cf305b635dc33b6ef3 /sim/ppc
parent21a2a3d567a2af583768b5f614403e65611c58a5 (diff)
downloadgdb-a3d3d9a7d9e0d5bf6168180f4f1b68ed37968f94.zip
gdb-a3d3d9a7d9e0d5bf6168180f4f1b68ed37968f94.tar.gz
gdb-a3d3d9a7d9e0d5bf6168180f4f1b68ed37968f94.tar.bz2
sim: ppc: cleanup getrusage decls
Don't conflate HAVE_GETRUSAGE & HAVE_SYS_RESOURCE_H. Use the latter to include the header and nothing else. Use the former to determine whether to use the function and nothing else. If we find a system that doesn't follow POSIX and provides only one of these, we can figure out how to support it then. The manual local definition is clashing with the system ones and leading to build failures with newer C standards. sim/ppc/emul_netbsd.c:51:5: error: a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C2x, conflicting with a previous declaration [-Werror,-Wdeprecated-non-prototype]
Diffstat (limited to 'sim/ppc')
-rw-r--r--sim/ppc/emul_netbsd.c9
-rw-r--r--sim/ppc/emul_unix.c9
-rw-r--r--sim/ppc/mon.c1
3 files changed, 2 insertions, 17 deletions
diff --git a/sim/ppc/emul_netbsd.c b/sim/ppc/emul_netbsd.c
index 51f8e98..950f1f4 100644
--- a/sim/ppc/emul_netbsd.c
+++ b/sim/ppc/emul_netbsd.c
@@ -40,15 +40,8 @@
#include "emul_generic.h"
#include "emul_netbsd.h"
-#ifdef HAVE_GETRUSAGE
-#ifndef HAVE_SYS_RESOURCE_H
-#undef HAVE_GETRUSAGE
-#endif
-#endif
-
-#ifdef HAVE_GETRUSAGE
+#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
-int getrusage();
#endif
#if HAVE_SYS_IOCTL_H
diff --git a/sim/ppc/emul_unix.c b/sim/ppc/emul_unix.c
index be9e838..88f6e3a 100644
--- a/sim/ppc/emul_unix.c
+++ b/sim/ppc/emul_unix.c
@@ -87,15 +87,8 @@
#include <sys/termio.h>
#endif
-#ifdef HAVE_GETRUSAGE
-#ifndef HAVE_SYS_RESOURCE_H
-#undef HAVE_GETRUSAGE
-#endif
-#endif
-
-#ifdef HAVE_GETRUSAGE
+#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
-int getrusage();
#endif
#if HAVE_DIRENT_H
diff --git a/sim/ppc/mon.c b/sim/ppc/mon.c
index 8ab42af..8bbabe6 100644
--- a/sim/ppc/mon.c
+++ b/sim/ppc/mon.c
@@ -36,7 +36,6 @@
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
-int getrusage();
#endif
#include "basics.h"