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]
This commit is contained in:
Mike Frysinger 2023-12-04 23:32:51 -05:00
parent 21a2a3d567
commit a3d3d9a7d9
3 changed files with 2 additions and 17 deletions

View File

@ -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

View File

@ -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

View File

@ -36,7 +36,6 @@
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
int getrusage();
#endif
#include "basics.h"