From 31346bb69e39e92b6228e01c75d787507d486b19 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 2 Jan 2002 02:25:29 +0000 Subject: 2002-01-01 Roland McGrath * nbd.c (htonll): Make this a macro using bswap_64 from . --- libstore/nbd.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'libstore/nbd.c') diff --git a/libstore/nbd.c b/libstore/nbd.c index 99db2a8f..ccd910fa 100644 --- a/libstore/nbd.c +++ b/libstore/nbd.c @@ -72,20 +72,14 @@ struct nbd_reply /* i/o functions. */ -static inline uint64_t -htonll (uint64_t x) -{ #if BYTE_ORDER == BIG_ENDIAN - return x; +# define htonll(x) (x) #elif BYTE_ORDER == LITTLE_ENDIAN - union { uint64_t ll; uint32_t l[2]; } u; - u.l[0] = htonl ((uint32_t) (x >> 32)); - u.l[1] = htonl ((uint32_t) x); - return u.ll; +# include +# define htonll(x) (bswap_64 (x)) #else # error what endian? #endif -} #define ntohll htonll -- cgit v1.2.3