4 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
5 # define htonl(x) (((x) << 24 & 0xFF000000UL) | ((x) << 8 & 0x00FF0000UL) | ((x) >> 8 & 0x0000FF00UL) | ((x) >> 24 & 0x000000FFUL))
6 # define htons(x) (((uint16_t)(x)&0xff00) >> 8) | (((uint16_t)(x)&0X00FF) << 8)
7 # define ntohl(x) htonl(x)
8 # define ntohs(x) htons(x)
9 #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
15 #error Could not determine byte order