From 2c6121db9ad84b8aad05b937e071ff7dcc9c8867 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Wed, 24 Nov 2021 03:46:42 +0100 Subject: Add Reverse Proxy implementation --- include/endianness.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include/endianness.h') diff --git a/include/endianness.h b/include/endianness.h index 2d6ad0e..1d414b3 100644 --- a/include/endianness.h +++ b/include/endianness.h @@ -31,6 +31,18 @@ #define htobe16 be16toh #endif +#ifndef le16toh +#if __BYTE_ORDER == __BIG_ENDIAN +#define le16toh(x) ((((x) & 0xFF00) >> 8) | (((x) & 0x00FF) << 8)) +#else +#define le16toh(x) (x) +#endif +#endif + +#ifndef htole16 +#define htole16 le16toh +#endif + #ifndef __bswap_32 #define __bswap_32(x) ((((x) & 0xFF000000) >> 24) \ | (((x) & 0x00FF0000) >> 8) \ -- cgit v1.1-32-gdbae