[syslinux:lwip] lwip: Use byteswap.h to define htons and friends

syslinux-bot for Eric W. Biederman ebiederm at xmission.com
Fri Apr 22 20:05:53 PDT 2011


Commit-ID:  a89bdfdcc7e432e18787472e5cacc745a93b928f
Gitweb:     http://syslinux.zytor.com/commit/a89bdfdcc7e432e18787472e5cacc745a93b928f
Author:     Eric W. Biederman <ebiederm at xmission.com>
AuthorDate: Sat, 9 Apr 2011 23:04:47 -0700
Committer:  Eric W. Biederman <ebiederm at xmission.com>
CommitDate: Tue, 12 Apr 2011 14:40:54 -0700

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 <ebiederm at xmission.com>


---
 core/lwip/src/include/lwipopts.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

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 <byteswap.h>
+
 #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__ */



More information about the Syslinux-commits mailing list