]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: ppc: cleanup getrusage decls
authorMike Frysinger <vapier@gentoo.org>
Tue, 5 Dec 2023 04:32:51 +0000 (23:32 -0500)
committerMike Frysinger <vapier@gentoo.org>
Tue, 5 Dec 2023 04:36:20 +0000 (23:36 -0500)
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
sim/ppc/emul_unix.c
sim/ppc/mon.c

index 51f8e98ae32b14a637aea9d07799f75e52c4b6f0..950f1f4a696a77555cc56b92bcfd7c7953b76c87 100644 (file)
 #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
index be9e8385f526645da5ebf83165bc82d886af893a..88f6e3abc0a2809b21026c7fd678f1370a590f0d 100644 (file)
 #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
index 8ab42af8458903210768a53a559428044119a6bf..8bbabe6e50d49004bf7ae87f78ac70ed87f798d6 100644 (file)
@@ -36,7 +36,6 @@
 
 #ifdef HAVE_SYS_RESOURCE_H
 #include <sys/resource.h>
-int getrusage();
 #endif
 
 #include "basics.h"