summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/sha2_internal.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2015-08-18 11:54:05 +0200
committerMichael Vogt <mvo@debian.org>2015-08-18 11:54:05 +0200
commit21248c0f00ee71412dbadc6ebf84011cf974346d (patch)
tree7dc1f5904399482d2128765b5b86d57a4ac5b3e1 /apt-pkg/contrib/sha2_internal.cc
parente5f34ad3b043abf033c1626eb8449b75955d6760 (diff)
parent4fc6b7570c3e97b65c118b58cdf6729fa94c9b03 (diff)
Merge branch 'debian/experimental' into feature/srv-records
Conflicts: cmdline/apt-helper.cc cmdline/makefile
Diffstat (limited to 'apt-pkg/contrib/sha2_internal.cc')
-rw-r--r--apt-pkg/contrib/sha2_internal.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/apt-pkg/contrib/sha2_internal.cc b/apt-pkg/contrib/sha2_internal.cc
index 131ff5beb..f70b7b17d 100644
--- a/apt-pkg/contrib/sha2_internal.cc
+++ b/apt-pkg/contrib/sha2_internal.cc
@@ -129,6 +129,14 @@ typedef u_int64_t sha2_word64; /* Exactly 8 bytes */
/*** ENDIAN REVERSAL MACROS *******************************************/
#if BYTE_ORDER == LITTLE_ENDIAN
+#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
+#define REVERSE32(w,x) { \
+ (x) = __builtin_bswap32(w); \
+}
+#define REVERSE64(w,x) { \
+ (x) = __builtin_bswap64(w); \
+}
+#else
#define REVERSE32(w,x) { \
sha2_word32 tmp = (w); \
tmp = (tmp >> 16) | (tmp << 16); \
@@ -142,6 +150,7 @@ typedef u_int64_t sha2_word64; /* Exactly 8 bytes */
(x) = ((tmp & 0xffff0000ffff0000ULL) >> 16) | \
((tmp & 0x0000ffff0000ffffULL) << 16); \
}
+#endif
#endif /* BYTE_ORDER == LITTLE_ENDIAN */
/*