summaryrefslogtreecommitdiff
path: root/deps
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2020-02-25 22:49:16 +0100
committerGitHub <noreply@github.com>2020-02-25 22:49:16 +0100
commita48da8fab662aaa77340a3e969ac0deec9d51731 (patch)
tree431b748a35fac643d9da7b613c0bea6237b8cae5 /deps
parent45ed17bdf49842fa5844f3db818e50fa45483dc2 (diff)
parentebade23333d1f5c460aeb7f02473c96c95568a91 (diff)
downloadlibgit2-a48da8fab662aaa77340a3e969ac0deec9d51731.tar.gz
Merge pull request #5417 from pks-t/pks/ntlmclient-htonll
deps: ntlmclient: fix missing htonll symbols on FreeBSD and SunOS
Diffstat (limited to 'deps')
-rw-r--r--deps/ntlmclient/compat.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/deps/ntlmclient/compat.h b/deps/ntlmclient/compat.h
index efdf34514..43bc86564 100644
--- a/deps/ntlmclient/compat.h
+++ b/deps/ntlmclient/compat.h
@@ -22,8 +22,30 @@
#endif
#ifdef __linux__
+/* See man page endian(3) */
# include <endian.h>
# define htonll htobe64
+#elif defined(__OpenBSD__)
+/* See man page htobe64(3) */
+# include <endian.h>
+# define htonll htobe64
+#elif defined(__FreeBSD__)
+/* See man page bwaps64(9) */
+# include <sys/endian.h>
+# define htonll bswap64
+#elif defined(sun) || defined(__sun)
+/* See man page byteorder(3SOCKET) */
+# include <sys/types.h>
+# include <netinet/in.h>
+# include <inttypes.h>
+
+# if !defined(htonll)
+# if defined(_BIG_ENDIAN)
+# define htonll(x) (x)
+# else
+# define htonll(x) ((((uint64_t)htonl(x)) << 32) + htonl((uint64_t)(x) >> 32))
+# endif
+# endif
#endif
#ifndef MIN