aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2015-10-14 20:45:49 +0200
committerAndreas Schneider <asn@cryptomilk.org>2015-10-20 17:16:38 +0200
commit21bf499bb4fbb4127f74966a6ea66ba282ee1cf5 (patch)
tree4eab0d43fae3c8646913fe3f93925c35ff9752fb /include
parent8ec46cbd42c2af7b7e1a06e3b3087e97526b558e (diff)
downloadlibssh-21bf499bb4fbb4127f74966a6ea66ba282ee1cf5.tar.gz
libssh-21bf499bb4fbb4127f74966a6ea66ba282ee1cf5.tar.xz
libssh-21bf499bb4fbb4127f74966a6ea66ba282ee1cf5.zip
agent: Fix agent auth on big endian machines
BUG: https://red.libssh.org/issues/204 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'include')
-rw-r--r--include/libssh/priv.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/libssh/priv.h b/include/libssh/priv.h
index 95a22c69..b7a80fe2 100644
--- a/include/libssh/priv.h
+++ b/include/libssh/priv.h
@@ -43,6 +43,16 @@
# endif
#endif /* !defined(HAVE_STRTOULL) */
+#ifdef HAVE_BYTESWAP_H
+#include <byteswap.h>
+#endif
+
+#ifndef bswap_32
+#define bswap_32(x) \
+ ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \
+ (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
+#endif
+
#ifdef _WIN32
/* Imitate define of inttypes.h */