ByteOrder.h: remove use of __builtin_bswap16.

* Fixes the build for host compilers older than gcc-4.8
This commit is contained in:
Jessica Hamilton
2014-05-30 08:45:57 +12:00
parent d0592a1164
commit 040dc2eebc
3 changed files with 9 additions and 8 deletions
+4
View File
@@ -31,6 +31,10 @@ typedef uint32_t in_addr_t;
# else
extern unsigned int __swap_int32(unsigned int); /* private */
# endif
static inline uint16_t __swap_int16(uint16_t arg)
{
return (arg >> 8) | (arg << 8);
}
extern uint16_t __swap_int16(uint16_t); /* private */
# if BYTE_ORDER == LITTLE_ENDIAN
# define htonl(x) ((uint32_t)__swap_int32(x))