aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJenkins BBVA <jenkins-bbva@users.noreply.github.com>2018-03-09 19:28:48 +0100
committerBruce A. Mah <bmah@kitchenlab.org>2018-03-09 10:28:48 -0800
commit4fe72e1979e281f0a216c6506a83eff1c4e4e9a4 (patch)
tree236d993cd4cd2a8645d5d45a2bc81305356def13 /src
parent85bedf1b830843080ea61702905c92b095279d90 (diff)
downloadiperf3-4fe72e1979e281f0a216c6506a83eff1c4e4e9a4.tar.gz
Add Solaris 10 portable_endian.h (#711)
Add htonll/ntohll if not defined
Diffstat (limited to 'src')
-rw-r--r--src/portable_endian.h10
1 files changed, 10 insertions, 0 deletions
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 <netinet/in.h>
# include <inttypes.h>
+# 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)