From 3c49cfb3447f61ced5bb64e8a23cc5abd4e84a2b Mon Sep 17 00:00:00 2001 From: Theo Buehler Date: Tue, 15 Aug 2023 23:52:26 +0200 Subject: Add htole32 and le32toh for macos and windows Windows assumes little endian for now... --- include/compat/endian.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/compat/endian.h b/include/compat/endian.h index 928affe..0945ece 100644 --- a/include/compat/endian.h +++ b/include/compat/endian.h @@ -51,7 +51,9 @@ #include #define be16toh(x) OSSwapBigToHostInt16((x)) #define htobe16(x) OSSwapHostToBigInt16((x)) +#define le32toh(x) OSSwapLittleToHostInt32((x)) #define be32toh(x) OSSwapBigToHostInt32((x)) +#define htole32(x) OSSwapHostToLittleInt32(x) #define htobe32(x) OSSwapHostToBigInt32(x) #define htole64(x) OSSwapHostToLittleInt64(x) #define htobe64(x) OSSwapHostToBigInt64(x) @@ -64,7 +66,9 @@ #define be16toh(x) ntohs((x)) #define htobe16(x) htons((x)) +#define le32toh(x) (x) #define be32toh(x) ntohl((x)) +#define htole32(x) (x) #define htobe32(x) ntohl((x)) #define be64toh(x) ntohll((x)) -- cgit v1.2.3-55-g6feb