summaryrefslogtreecommitdiff
path: root/libutils/Unicode.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-11-22 07:51:18 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-11-22 07:51:19 +0000
commit0101b06fa6f9863ee87e89757e70900c3a0e7bfc (patch)
tree9600e6111d284258123390990b0a10c3dd301fe9 /libutils/Unicode.cpp
parenteda16b98dce3ef4c75b7b46c6acdab2b6970f54a (diff)
parent97ac0e1bb42ddd17c75691ecbe1df8a6520d4c81 (diff)
Merge "Kill HAVE_BIG_ENDIAN, HAVE_ENDIAN_H, and HAVE_LITTLE_ENDIAN."
Diffstat (limited to 'libutils/Unicode.cpp')
-rw-r--r--libutils/Unicode.cpp15
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