summaryrefslogtreecommitdiff
path: root/lib/libc/endian/htobe64.c
blob: ef39de6af1439ca5726142f3c500a3a55adbeec6 (plain)
1
2
3
4
5
6
7
8
9
10
#include <endian.h>

uint64_t htobe64(uint64_t host_64bits)
{
#if __BYTE_ORDER == __LITTLE_ENDIAN
	return __builtin_bswap64(host_64bits);
#else
	return host_64bits;
#endif
}