diff options
Diffstat (limited to 'lib/libc/endian/htobe64.c')
| -rw-r--r-- | lib/libc/endian/htobe64.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/libc/endian/htobe64.c b/lib/libc/endian/htobe64.c new file mode 100644 index 00000000..ef39de6a --- /dev/null +++ b/lib/libc/endian/htobe64.c @@ -0,0 +1,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 +} |
