From a89bdfdcc7e432e18787472e5cacc745a93b928f Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Sat, 9 Apr 2011 23:04:47 -0700 Subject: [PATCH] lwip: Use byteswap.h to define htons and friends Define lwip's byteswapping in terms of byteswap.h This ensures htons(CONSTANT) is seen as a constant by gcc, and it allows us to use unmodified lwip headers. Signed-off-by: Eric W. Biederman --- core/lwip/src/include/lwipopts.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/lwip/src/include/lwipopts.h b/core/lwip/src/include/lwipopts.h index dea91c4..34ddd70 100644 --- a/core/lwip/src/include/lwipopts.h +++ b/core/lwip/src/include/lwipopts.h @@ -1,6 +1,8 @@ #ifndef __LWIPOPTS_H__ #define __LWIPOPTS_H__ +#include + #define SYS_LIGHTWEIGHT_PROT 1 #define LWIP_NETIF_API 1 #define LWIP_DNS 1 @@ -55,4 +57,8 @@ #define LWIP_STATS 1 #define LWIP_STATS_DISPLAY 1 +#define LWIP_PLATFORM_BYTESWAP 1 +#define LWIP_PLATFORM_HTONS(x) bswap_16(x) +#define LWIP_PLATFORM_HTONL(x) bswap_32(x) + #endif /* __LWIPOPTS_H__ */ -- 2.7.4