blob: 54a363c8ef8d5f2dfc39e46d6e331d81105201be (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
#include <endian.h> // for htobe64
#include <stdint.h> // for uint64_t
uint64_t htobe64(uint64_t host_64bits)
{
#if __BYTE_ORDER == __LITTLE_ENDIAN
return __builtin_bswap64(host_64bits);
#else
return host_64bits;
#endif
}
|