You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// ntohll => network to host long long => big endian to host endian, 64bit => BETOHE64// ntohl => network to host long => big endian to host endian, 32bit => BETOHE32// htonll => host to network long long => host endian to big endian, 64bit => HETOBE64// htonl => host to network long => host endian to big endian, 32 bit => HETOBE32
#if !defined(HETOBE16)
#if !defined(__BYTE_ORDER__)
#error Failed to detect byte order!
#endif
#if __BYTE_ORDER == __BIG_ENDIAN
// host endian to big endian 64bit
#defineHETOBE64(x) (x)
// host endian to little endian 64bit
#defineHETOLE64(x) __bswap_constant_64(x)
// host endian to big endian 32bit
#defineHETOBE32(x) (x)
// host endian to little endian 32bit
#defineHETOLE32(x) __bswap_constant_32(x)
// host endian to big endian 16bit
#defineHETOBE16(x) (x)
// host endian to little endian 16bit
#defineHETOLE16(x) __bswap_constant_16(x)
// little endian to host endian 64bit
#defineLETOHE64(x) __bswap_constant_64(x)
// big endian to host endian 64bit
#defineBETOHE64(x) (x)
// little endian to host endian 32bit
#defineLETOHE32(x) __bswap_constant_32(x)
// big endian to host endian 32bit
#defineBETOHE32(x) (x)
// little endian to host endian 16bit
#defineLETOHE16(x) __bswap_constant_16(x)
// big endian to host endian 16bit
#defineBETOHE16(x) (x)
#else
#if __BYTE_ORDER == __LITTLE_ENDIAN
// host endian to big endian 64bit
#defineHETOBE64(x) __bswap_constant_64(x)
// host endian to little endian 64bit
#defineHETOLE64(x) (x)
// host endian to big endian 32bit
#defineHETOBE32(x) __bswap_constant_32(x)
// host endian to little endian 32bit
#defineHETOLE32(x) (x)
// host endian to big endian 16bit
#defineHETOBE16(x) __bswap_constant_16(x)
// host endian to little endian 16bit
#defineHETOLE16(x) (x)
// little endian to host endian 64bit
#defineLETOHE64(x) (x)
// big endian to host endian 64bit
#defineBETOHE64(x) __bswap_constant_64(x)
// little endian to host endian 32bit
#defineLETOHE32(x) (x)
// big endian to host endian 32bit
#defineBETOHE32(x) __bswap_constant_32(x)
// little endian to host endian 16bit
#defineLETOHE16(x) (x)
// big endian to host endian 16bit
#defineBETOHE16(x) __bswap_constant_16(x)
#else
#error Failed to detect byte order! appears to be neither big endian nor little endian..
#endif
#endif
#endif
The text was updated successfully, but these errors were encountered:
should do something like this instead imo
The text was updated successfully, but these errors were encountered: