Use some includes only according to the #ifdef block of the respective
code, or matching the fact they are Linux-only. This way, includes
potentially unportable are not unconditionally used.
Signed-off-by: Pino Toscano <toscano.pino@tiscali.it>
+2015-06-26 Pino Toscano <toscano.pino@tiscali.it>
+
+ * i386_initreg.c: Reduce scope of some includes to match their usage.
+
2015-04-28 Mark Wielaard <mjw@redhat.com>
* aarch64_reloc.def: Drop "64" from TLS_DTPMOD64, TLS_DTPREL64 and
# include <config.h>
#endif
-#if defined __i386__ || defined __x86_64__
+#if (defined __i386__ || defined __x86_64__) && defined(__linux__)
# include <sys/types.h>
# include <sys/user.h>
# include <sys/ptrace.h>
+2015-06-26 Pino Toscano <toscano.pino@tiscali.it>
+
+ * tests/backtrace-data.c: Reduce scope of some includes to match their
+ usage.
+ * tests/backtrace.c: Likewise.
+ * tests/deleted.c: Likewise.
+
2015-06-16 Mark Wielaard <mjw@redhat.com>
* run-strip-test.sh: Add strip-in-place (eu-strip without -o) test
#include <error.h>
#include <unistd.h>
#include <dwarf.h>
+#if defined(__x86_64__) && defined(__linux__)
#include <sys/resource.h>
#include <sys/ptrace.h>
#include <signal.h>
#include <fcntl.h>
#include <string.h>
#include ELFUTILS_HEADER(dwfl)
+#endif
#if !defined(__x86_64__) || !defined(__linux__)
#include <error.h>
#include <unistd.h>
#include <dwarf.h>
+#ifdef __linux__
#include <sys/resource.h>
#include <sys/ptrace.h>
#include <signal.h>
#include <string.h>
#include <argp.h>
#include ELFUTILS_HEADER(dwfl)
+#endif
#ifndef __linux__
#include <stdio.h>
#include <error.h>
#include <errno.h>
+#ifdef __linux__
#include <sys/prctl.h>
+#endif
extern void libfunc (void);