aboutsummaryrefslogtreecommitdiff
path: root/include/libssh/priv.h
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:17:17 +0200
commit0425ac9ad0f8f1cefa12b448d31a400ced3e89b9 (patch)
treec7ea41774230afd7efaaabcdc35f07a885d4aa3d /include/libssh/priv.h
parent367558bb215518bfd77745389edb84d974df99bb (diff)
downloadlibssh-0425ac9ad0f8f1cefa12b448d31a400ced3e89b9.tar.gz
libssh-0425ac9ad0f8f1cefa12b448d31a400ced3e89b9.tar.xz
libssh-0425ac9ad0f8f1cefa12b448d31a400ced3e89b9.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/libssh/priv.h')
-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 */