Commit a5eb7e028727a90cc87cda3bbf1d6dc3d9ba30b4

Edward Thomson 2020-08-31T12:52:48

Merge pull request #5612 from mmuman/haiku deps: ntlmclient: fix htonll for Haiku

diff --git a/deps/ntlmclient/compat.h b/deps/ntlmclient/compat.h
index f4d859a..6e5ef64 100644
--- a/deps/ntlmclient/compat.h
+++ b/deps/ntlmclient/compat.h
@@ -21,7 +21,9 @@
 # include <stdbool.h>
 #endif
 
-#ifdef __linux__
+#if defined(_WIN32) || defined(__APPLE__)
+/* winsock and macOS > 10.9 have htonll already */
+#elif defined(__linux__)
 /* See man page endian(3) */
 # include <endian.h>
 # define htonll htobe64
@@ -46,6 +48,11 @@
 #   define htonll(x) ((((uint64_t)htonl(x)) << 32) + htonl((uint64_t)(x) >> 32))
 #  endif
 # endif
+#elif defined(__HAIKU__)
+# include <ByteOrder.h>
+# define htonll B_HOST_TO_BENDIAN_INT64
+#else
+# error "Please implement htonll for your platform"
 #endif
 
 #ifndef MIN