diff options
author | Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp> | 2016-10-11 23:06:48 +0900 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2016-10-12 15:43:14 +0200 |
commit | 60b2bf1b08c621492410b24e469b2bdf58d167d5 (patch) | |
tree | 9a9f16d5a686b42469c190a7d3b0bd245344dc48 /libdwfl | |
parent | 7bf4b63a4980788e6c1969cae02f0483e79c069f (diff) | |
download | elfutils-60b2bf1b08c621492410b24e469b2bdf58d167d5.tar.gz |
lib: Provide MAX and MIN in system.h
This change also creates a new header file libeu.h to provide the
prototypes for the function of libeu. That hides the definition of function
crc32, which can conflict with zlib, from libelf. It also prevents mistakes
to refer those functions from a component which doesn't link with libeu,
such as libelf.
Signed-off-by: Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
Diffstat (limited to 'libdwfl')
-rw-r--r-- | libdwfl/ChangeLog | 10 | ||||
-rw-r--r-- | libdwfl/core-file.c | 1 | ||||
-rw-r--r-- | libdwfl/dwfl_segment_report_module.c | 7 | ||||
-rw-r--r-- | libdwfl/frame_unwind.c | 5 | ||||
-rw-r--r-- | libdwfl/linux-core-attach.c | 4 | ||||
-rw-r--r-- | libdwfl/linux-pid-attach.c | 4 |
6 files changed, 13 insertions, 18 deletions
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index 3332db7a..27c5d6ef 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -1,3 +1,13 @@ +2015-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp> + + * core-file.c: Remove sys/param.h. + * dwfl_segment_report_module.c: Likewise. Add system.h include. + (MAX): Remove definition. + * frame_unwind.c: Add system.h include. + (MAX): Remove definition. + * linux-core-attach.c (MIN): Remove definition. + * linux-pid-attach.c (MAX): Likewise. + 2016-08-12 Mark Wielaard <mjw@redhat.com> * link_map.c (dwfl_link_map_report): Fix assert, set in.d_size. diff --git a/libdwfl/core-file.c b/libdwfl/core-file.c index 67684c9a..84cb89ac 100644 --- a/libdwfl/core-file.c +++ b/libdwfl/core-file.c @@ -32,7 +32,6 @@ #include "libdwflP.h" #include <gelf.h> -#include <sys/param.h> #include <unistd.h> #include <endian.h> #include <byteswap.h> diff --git a/libdwfl/dwfl_segment_report_module.c b/libdwfl/dwfl_segment_report_module.c index 40553c94..207a2573 100644 --- a/libdwfl/dwfl_segment_report_module.c +++ b/libdwfl/dwfl_segment_report_module.c @@ -35,11 +35,12 @@ #include <elf.h> #include <gelf.h> #include <inttypes.h> -#include <sys/param.h> #include <endian.h> #include <unistd.h> #include <fcntl.h> +#include <system.h> + /* A good size for the initial read from memory, if it's not too costly. This more than covers the phdrs and note segment in the average 64-bit @@ -53,10 +54,6 @@ # define MY_ELFDATA ELFDATA2MSB #endif -#ifndef MAX -# define MAX(a, b) ((a) > (b) ? (a) : (b)) -#endif - /* Return user segment index closest to ADDR but not above it. If NEXT, return the closest to ADDR but not below it. */ diff --git a/libdwfl/frame_unwind.c b/libdwfl/frame_unwind.c index a885446f..fb42c1a7 100644 --- a/libdwfl/frame_unwind.c +++ b/libdwfl/frame_unwind.c @@ -35,6 +35,7 @@ #include "libdwflP.h" #include "../libdw/dwarf.h" #include <sys/ptrace.h> +#include <system.h> /* Maximum number of DWARF expression stack slots before returning an error. */ #define DWARF_EXPR_STACK_MAX 0x100 @@ -43,10 +44,6 @@ error. */ #define DWARF_EXPR_STEPS_MAX 0x1000 -#ifndef MAX -# define MAX(a, b) ((a) > (b) ? (a) : (b)) -#endif - bool internal_function __libdwfl_frame_reg_get (Dwfl_Frame *state, unsigned regno, Dwarf_Addr *val) diff --git a/libdwfl/linux-core-attach.c b/libdwfl/linux-core-attach.c index 5a7b3b3d..93d0e46e 100644 --- a/libdwfl/linux-core-attach.c +++ b/libdwfl/linux-core-attach.c @@ -32,10 +32,6 @@ #include "../libdw/memory-access.h" -#ifndef MIN -# define MIN(a, b) ((a) < (b) ? (a) : (b)) -#endif - struct core_arg { Elf *core; diff --git a/libdwfl/linux-pid-attach.c b/libdwfl/linux-pid-attach.c index c13f2b62..adfc7f81 100644 --- a/libdwfl/linux-pid-attach.c +++ b/libdwfl/linux-pid-attach.c @@ -37,10 +37,6 @@ #include <sys/syscall.h> #include <unistd.h> -#ifndef MAX -# define MAX(a, b) ((a) > (b) ? (a) : (b)) -#endif - #ifdef __linux__ static bool |