diff options
Diffstat (limited to 'lib/libc/endian/htole32.c')
| -rw-r--r-- | lib/libc/endian/htole32.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/libc/endian/htole32.c b/lib/libc/endian/htole32.c new file mode 100644 index 00000000..6c9a3cdc --- /dev/null +++ b/lib/libc/endian/htole32.c @@ -0,0 +1,10 @@ +#include <endian.h> + +uint32_t htole32(uint32_t host_32bits) +{ +#if __BYTE_ORDER == __BIG_ENDIAN + return __builtin_bswap32(host_32bits); +#else + return host_32bits; +#endif +} |
