This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[partial commit] [unwinder-portable] [patch 3/3] Older OS compatibility bits


On Wed, 06 Nov 2013 11:49:03 +0100, Mark Wielaard wrote:
> Looks fine for the portable branch.

Checked in without the tests/ part.


Thanks,
Jan

commit dad4e19f90c4211b79efb8ad25d3323b6e7f0239
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Sat Nov 9 19:46:54 2013 +0100

    Older OS compatibility bits.
    
    Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>

diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index be780d1..03794d3 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,5 +1,11 @@
 2013-11-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
+	Older OS compatibility bits.
+	* linux-core-attach.c (be64toh, le64toh, be32toh, le32toh): Provide
+	fallbacks if not defined by system.
+
+2013-11-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
 	Handle T-stopped detach for old kernels.
 	* linux-pid-attach.c (struct pid_arg): New field stopped.
 	(ptrace_attach): New parameter stoppedp.  Set it appropriately.
diff --git a/libdwfl/linux-core-attach.c b/libdwfl/linux-core-attach.c
index 106d764..e2fb3ad 100644
--- a/libdwfl/linux-core-attach.c
+++ b/libdwfl/linux-core-attach.c
@@ -29,6 +29,35 @@
 #include "libdwflP.h"
 #include <fcntl.h>
 #include "system.h"
+#include <endian.h>
+#include <byteswap.h>
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+# ifndef be64toh
+#  define be64toh(x) bswap_64 (x)
+# endif
+# ifndef le64toh
+#  define le64toh(x) (x)
+# endif
+# ifndef be32toh
+#  define be32toh(x) bswap_32 (x)
+# endif
+# ifndef le32toh
+#  define le32toh(x) (x)
+# endif
+#else
+# ifndef be64toh
+#  define be64toh(x) (x)
+# endif
+# ifndef le64toh
+#  define le64toh(x) bswap_64 (x)
+# endif
+# ifndef be32toh
+#  define be32toh(x) (x)
+# endif
+# ifndef le32toh
+#  define le32toh(x) bswap_32 (x)
+# endif
+#endif
 
 #ifndef MIN
 # define MIN(a, b) ((a) < (b) ? (a) : (b))

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]