From cf5087a8397e379d059998b27ef86a1bb68d70ff Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Sun, 12 Feb 2017 16:40:38 +0100 Subject: include: Use width in endian naming convention ntohll and ntohl have been renamed ntoh64 and ntoh32, htonll and htonl have been renamed hton64 and hton32. --- include/ouroboros/endian.h | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'include') diff --git a/include/ouroboros/endian.h b/include/ouroboros/endian.h index c6b0d80a..745f0c57 100644 --- a/include/ouroboros/endian.h +++ b/include/ouroboros/endian.h @@ -132,23 +132,15 @@ static inline uint64_t bswap_64(uint64_t x) { #endif #ifdef CPU_LITTLE_ENDIAN -#define htonll(x) bswap_64(x) -#ifndef htonl -#define htonl(x) bswap_32(x) -#endif -#define ntohll(x) bswap_64(x) -#ifndef ntohl -#define ntohl(x) bswap_32(x) -#endif +#define hton64(x) bswap_64(x) +#define hton32(x) bswap_32(x) +#define ntoh64(x) bswap_64(x) +#define ntoh32(x) bswap_32(x) #else /* CPU_LITTLE_ENDIAN */ -#define htonll(x) (x) -#ifndef htonl -#define htonl(x) (x) -#endif -#define ntohll(x) (x) -#ifndef ntohl -#define nothl(x) (x) -#endif +#define hton64(x) (x) +#define hton32(x) (x) +#define ntoh64(x) (x) +#define noth32(x) (x) #endif /* CPU_LITTLE_ENDIAN */ #endif /* OUROBOROS_ENDIAN_H */ -- cgit v1.2.3