aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libctf/ChangeLog7
-rw-r--r--libctf/ctf-endian.h6
2 files changed, 10 insertions, 3 deletions
diff --git a/libctf/ChangeLog b/libctf/ChangeLog
index 8a82ed0..08eb02b 100644
--- a/libctf/ChangeLog
+++ b/libctf/ChangeLog
@@ -1,3 +1,10 @@
+2019-07-11 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * ctf-endian.h: Don't assume htole64 and le64toh are always
+ present if HAVE_ENDIAN_H; also check if htole64 is defined.
+ [!WORDS_BIGENDIAN] (htole64, le64toh): Define as identity,
+ not bswap_identity_64.
+
2019-09-18 Alan Modra <amodra@gmail.com>
* ctf-open-bfd.c: Update throughout for bfd section macro changes.
diff --git a/libctf/ctf-endian.h b/libctf/ctf-endian.h
index ec177d1..f1cc527 100644
--- a/libctf/ctf-endian.h
+++ b/libctf/ctf-endian.h
@@ -24,10 +24,10 @@
#include <stdint.h>
#include "swap.h"
-#ifndef HAVE_ENDIAN_H
+#if !defined (HAVE_ENDIAN_H) || !defined (htole64)
#ifndef WORDS_BIGENDIAN
-# define htole64(x) bswap_identity_64 ((x))
-# define le64toh(x) bswap_identity_64 ((x))
+# define htole64(x) (x)
+# define le64toh(x) (x)
#else
# define htole64(x) bswap_64 ((x))
# define le64toh(x) bswap_64 ((x))