diff options
author | Elliott Hughes <enh@google.com> | 2014-11-21 23:01:59 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2014-11-21 23:10:45 -0800 |
commit | 97ac0e1bb42ddd17c75691ecbe1df8a6520d4c81 (patch) | |
tree | e899f951a44088d5351cdbc8e2fb2249b038ef9d /libutils/Unicode.cpp | |
parent | 6fe92d1a3fb17545d82d020a3c995f32e6b71f9d (diff) | |
download | system_core-97ac0e1bb42ddd17c75691ecbe1df8a6520d4c81.tar.gz system_core-97ac0e1bb42ddd17c75691ecbe1df8a6520d4c81.tar.bz2 system_core-97ac0e1bb42ddd17c75691ecbe1df8a6520d4c81.zip |
Kill HAVE_BIG_ENDIAN, HAVE_ENDIAN_H, and HAVE_LITTLE_ENDIAN.
Change-Id: I9e25ac9d27e95b04fb8bf7a66c619af0139d8b8f
Diffstat (limited to 'libutils/Unicode.cpp')
-rw-r--r-- | libutils/Unicode.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
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 <netinet/in.h> #endif |