summaryrefslogtreecommitdiff
path: root/lib/libc/endian/htole64.c
blob: 848d61ebc13fd2b6d7b37201bb7cd693f177c485 (plain)
1
2
3
4
5
6
7
8
9
10
11
#include <endian.h> // for uint64_t, htole64
#include <stdint.h>

uint64_t htole64(uint64_t host_64bits)
{
#if __BYTE_ORDER == __BIG_ENDIAN
	return __builtin_bswap64(host_64bits);
#else
	return host_64bits;
#endif
}