From dd9fe9761ac714b1ea60f3b4ad4226c7ef1a288b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Wed, 29 Dec 2021 09:49:18 +0000 Subject: [PATCH 1/2] Replace lwIP byte order functions with built-in functions --- components/lwip/port/esp32/include/arch/cc.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/lwip/port/esp32/include/arch/cc.h b/components/lwip/port/esp32/include/arch/cc.h index f17c49783a..1601bfe612 100644 --- a/components/lwip/port/esp32/include/arch/cc.h +++ b/components/lwip/port/esp32/include/arch/cc.h @@ -50,6 +50,12 @@ extern "C" { #define BYTE_ORDER LITTLE_ENDIAN #endif // BYTE_ORDER +#define LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS +#define htons(x) __builtin_bswap16(x) +#define ntohs(x) __builtin_bswap16(x) +#define htonl(x) __builtin_bswap32(x) +#define ntohl(x) __builtin_bswap32(x) + #ifndef CONFIG_LWIP_ESP_LWIP_ASSERT #define LWIP_NOASSERT 1 #endif From 6f2e0d53a4f7286cdaceec39493c520f1d809c41 Mon Sep 17 00:00:00 2001 From: David Cermak Date: Fri, 7 Jan 2022 16:38:40 +0100 Subject: [PATCH 2/2] lwip: Fix spacing issue --- components/lwip/port/esp32/include/arch/cc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/lwip/port/esp32/include/arch/cc.h b/components/lwip/port/esp32/include/arch/cc.h index 1601bfe612..9e038d11d9 100644 --- a/components/lwip/port/esp32/include/arch/cc.h +++ b/components/lwip/port/esp32/include/arch/cc.h @@ -55,7 +55,7 @@ extern "C" { #define ntohs(x) __builtin_bswap16(x) #define htonl(x) __builtin_bswap32(x) #define ntohl(x) __builtin_bswap32(x) - + #ifndef CONFIG_LWIP_ESP_LWIP_ASSERT #define LWIP_NOASSERT 1 #endif