aboutsummaryrefslogtreecommitdiffstats
path: root/include/os/freebsd/spl/sys/byteorder.h
diff options
context:
space:
mode:
authorMatt Macy <mmacy@FreeBSD.org>2020-10-17 00:05:34 +0000
committerMatt Macy <mmacy@FreeBSD.org>2020-10-17 00:05:34 +0000
commit0be360124f8f108f73365e31448e7550f877f3ac (patch)
tree78557e980720fdcfd76497e6630c29ce1688559c /include/os/freebsd/spl/sys/byteorder.h
parente2228bd99047bb6a0cef0da931147b1f28f155c2 (diff)
downloadsrc-vendor/openzfs.tar.gz
src-vendor/openzfs.zip
Update OpenZFS to 2.0.0-rc3-gbd565fvendor/openzfs/2.0.0-rc3-gfc5966vendor/openzfs
Notes
Notes: svn path=/vendor-sys/openzfs/dist/; revision=366774 svn path=/vendor-sys/openzfs/2.0.0-rc3-gfc5966/; revision=366775; tag=vendor/openzfs/2.0.0-rc3-gfc5966
Diffstat (limited to 'include/os/freebsd/spl/sys/byteorder.h')
-rw-r--r--include/os/freebsd/spl/sys/byteorder.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/os/freebsd/spl/sys/byteorder.h b/include/os/freebsd/spl/sys/byteorder.h
index ae767242bd18..0b3d01eb3759 100644
--- a/include/os/freebsd/spl/sys/byteorder.h
+++ b/include/os/freebsd/spl/sys/byteorder.h
@@ -80,10 +80,11 @@
#define BE_64(x) BSWAP_64(x)
#endif
+#if !defined(_STANDALONE)
#if BYTE_ORDER == _BIG_ENDIAN
#define htonll(x) BMASK_64(x)
#define ntohll(x) BMASK_64(x)
-#else
+#else /* BYTE_ORDER == _LITTLE_ENDIAN */
#ifndef __LP64__
static __inline__ uint64_t
htonll(uint64_t n)
@@ -96,11 +97,12 @@ ntohll(uint64_t n)
{
return ((((uint64_t)ntohl(n)) << 32) + ntohl(n >> 32));
}
-#else
+#else /* !__LP64__ */
#define htonll(x) BSWAP_64(x)
#define ntohll(x) BSWAP_64(x)
-#endif
-#endif
+#endif /* __LP64__ */
+#endif /* BYTE_ORDER */
+#endif /* _STANDALONE */
#define BE_IN32(xa) htonl(*((uint32_t *)(void *)(xa)))