__builtin_bswap32()
is used to reverse bytes (it\'s used for littel/big endian issues (from gcc)).
htonl()
is used to reverse bytes too (conver
I disagree with your statement that htonl()
is used to reverse byte order. It is used to convert from host to network byte order. Depending on the byte order of the host, that may, or may not, result in byte order being reversed.
I suggest that you use the function that expresses the correct semantic intent:
htonl()
.__builtin_bswap32()
.