]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Reduce scope of some includes
authorPino Toscano <toscano.pino@tiscali.it>
Fri, 26 Jun 2015 18:36:01 +0000 (20:36 +0200)
committerMark Wielaard <mjw@redhat.com>
Sat, 27 Jun 2015 12:56:12 +0000 (14:56 +0200)
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>
backends/ChangeLog
backends/i386_initreg.c
tests/ChangeLog
tests/backtrace-data.c
tests/backtrace.c
tests/deleted.c

index fe61d9cc101f74cfcf125dda5f1dc76975b37456..c95e80f1200bf61072ea8ab1fb7f993418c0ac3b 100644 (file)
@@ -1,3 +1,7 @@
+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
index 51fd9ea60f23b0adc39f916a92e3ed0a4e995878..c34428232e905271b7a62c89b97c301a74be1db7 100644 (file)
@@ -30,7 +30,7 @@
 # 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>
index 34f89cc4bd8e6bf6d673e33457865bb3f0411dd3..3a7d3125d55ce18ee050726bb17ce4f8da96a93b 100644 (file)
@@ -1,3 +1,10 @@
+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
index 5a93a9cc630c653da74f00149d7f5586e57bfa69..bc5ceba0dd2200d8fc9a8114c50b1e23f2de43d5 100644 (file)
@@ -30,6 +30,7 @@
 #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>
@@ -39,6 +40,7 @@
 #include <fcntl.h>
 #include <string.h>
 #include ELFUTILS_HEADER(dwfl)
+#endif
 
 #if !defined(__x86_64__) || !defined(__linux__)
 
index abd56ab66e3e90d947bc13e3edf1848a28dbb0f3..1247643025e074f76b41c99401bb86582549ed11 100644 (file)
@@ -27,6 +27,7 @@
 #include <error.h>
 #include <unistd.h>
 #include <dwarf.h>
+#ifdef __linux__
 #include <sys/resource.h>
 #include <sys/ptrace.h>
 #include <signal.h>
@@ -37,6 +38,7 @@
 #include <string.h>
 #include <argp.h>
 #include ELFUTILS_HEADER(dwfl)
+#endif
 
 #ifndef __linux__
 
index d071bf79edd53370b2141f5171463aca03b8e561..6be35bc2fe5cc82247a30056fa7daff198b76b24 100644 (file)
@@ -23,7 +23,9 @@
 #include <stdio.h>
 #include <error.h>
 #include <errno.h>
+#ifdef __linux__
 #include <sys/prctl.h>
+#endif
 
 extern void libfunc (void);