]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Older OS compatibility bits.
authorJan Kratochvil <jan.kratochvil@redhat.com>
Sat, 9 Nov 2013 18:46:54 +0000 (19:46 +0100)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Sat, 9 Nov 2013 18:46:54 +0000 (19:46 +0100)
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
libdwfl/ChangeLog
libdwfl/linux-core-attach.c

index be780d1d75f3b6fd8b15ce2e1062e679f1ed4484..03794d3b4a84466fed27a4276697b3c54bf6fa87 100644 (file)
@@ -1,3 +1,9 @@
+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.
index 106d7649ad261f3e6db631bd119b1f8cff6c41f1..e2fb3ad5c4578cac781d1f9f1d222286f71fe1fd 100644 (file)
 #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))