From 0538adbabd255411711b4d126c0d31a66c715c00 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 26 Jun 2019 21:10:56 +0200 Subject: [PATCH] LibC: Uhm, htonl() shouldn't byte-swap on big endian machines. --- LibC/arpa/inet.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/LibC/arpa/inet.h b/LibC/arpa/inet.h index 63e32061c4..ccb2650436 100644 --- a/LibC/arpa/inet.h +++ b/LibC/arpa/inet.h @@ -27,7 +27,11 @@ inline uint16_t ntohs(uint16_t value) inline uint32_t htonl(uint32_t value) { +#if BYTE_ORDER == LITTLE_ENDIAN return __builtin_bswap32(value); +#else + return value; +#endif } inline uint32_t ntohl(uint32_t value)