[1/3,committed] sim: ppc: cleanup getrusage decls
Checks
Commit Message
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]
---
sim/ppc/emul_netbsd.c | 9 +--------
sim/ppc/emul_unix.c | 9 +--------
sim/ppc/mon.c | 1 -
3 files changed, 2 insertions(+), 17 deletions(-)
@@ -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
@@ -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
@@ -36,7 +36,6 @@
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
-int getrusage();
#endif
#include "basics.h"