mirror of
https://github.com/libgit2/libgit2.git
synced 2026-06-23 06:56:27 +00:00
deps: ntlmclient: fix missing htonll symbols on FreeBSD and SunOS
The ntlmclient dependency defines htonll on Linux-based systems, only. As a result, non-Linux systems will run into compiler and/or linker errors due to undefined symbols. Fix this issue for FreeBSD, OpenBSD and SunOS/OpenSolaris by including the proper headers and defining the symbol accordingly.
This commit is contained in:
22
deps/ntlmclient/compat.h
vendored
22
deps/ntlmclient/compat.h
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user