From 4fe72e1979e281f0a216c6506a83eff1c4e4e9a4 Mon Sep 17 00:00:00 2001 From: Jenkins BBVA Date: Fri, 9 Mar 2018 19:28:48 +0100 Subject: [PATCH] Add Solaris 10 portable_endian.h (#711) Add htonll/ntohll if not defined --- src/portable_endian.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/portable_endian.h b/src/portable_endian.h index cd90375..85a6147 100644 --- a/src/portable_endian.h +++ b/src/portable_endian.h @@ -71,6 +71,16 @@ # include # include +# if !defined (ntohll) || !defined(htonll) +# ifdef _BIG_ENDIAN +# define htonll(x) (x) +# define ntohll(x) (x) +# else +# define htonll(x) ((((uint64_t)htonl(x)) << 32) + htonl((uint64_t)(x) >> 32)) +# define ntohll(x) ((((uint64_t)ntohl(x)) << 32) + ntohl((uint64_t)(x) >> 32)) +# endif +# endif + # define be64toh(x) ntohll(x) # define htobe64(x) htonll(x)