23 #ifndef __NETWORK_ENDIAN_H_
24 #define __NETWORK_ENDIAN_H_
40 inline uint64_t
bswap64( uint64_t value ) {
return __builtin_bswap64(value); }
41 inline uint32_t
bswap32( uint32_t value ) {
return __builtin_bswap32(value); }
42 inline uint16_t
bswap16( uint16_t value ) {
return ((value >> 8) | (value << 8)); }
48 #if (__BYTE_ORDER == __LITTLE_ENDIAN)
54 #elif (__BYTE_ORDER == __BIG_ENDIAN)
56 inline uint64_t
netswap64( uint64_t value ) {
return value; }
57 inline uint32_t
netswap32( uint32_t value ) {
return value; }
58 inline uint16_t
netswap16( uint16_t value ) {
return value; }