From 97ac0e1bb42ddd17c75691ecbe1df8a6520d4c81 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 21 Nov 2014 23:01:59 -0800 Subject: Kill HAVE_BIG_ENDIAN, HAVE_ENDIAN_H, and HAVE_LITTLE_ENDIAN. Change-Id: I9e25ac9d27e95b04fb8bf7a66c619af0139d8b8f --- libutils/Unicode.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'libutils/Unicode.cpp') diff --git a/libutils/Unicode.cpp b/libutils/Unicode.cpp index 378d2a786..d9334f783 100644 --- a/libutils/Unicode.cpp +++ b/libutils/Unicode.cpp @@ -24,17 +24,10 @@ # undef nhtos # undef htons -# ifdef HAVE_LITTLE_ENDIAN -# define ntohl(x) ( ((x) << 24) | (((x) >> 24) & 255) | (((x) << 8) & 0xff0000) | (((x) >> 8) & 0xff00) ) -# define htonl(x) ntohl(x) -# define ntohs(x) ( (((x) << 8) & 0xff00) | (((x) >> 8) & 255) ) -# define htons(x) ntohs(x) -# else -# define ntohl(x) (x) -# define htonl(x) (x) -# define ntohs(x) (x) -# define htons(x) (x) -# endif +# define ntohl(x) ( ((x) << 24) | (((x) >> 24) & 255) | (((x) << 8) & 0xff0000) | (((x) >> 8) & 0xff00) ) +# define htonl(x) ntohl(x) +# define ntohs(x) ( (((x) << 8) & 0xff00) | (((x) >> 8) & 255) ) +# define htons(x) ntohs(x) #else # include #endif -- cgit v1.2.3