mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-16 07:09:58 +00:00
changed the semantics of LWIP_PREFIX_BYTEORDER_FUNCS to prevent "symbol already defined" i.e. when linking to winsock
This commit is contained in:
parent
290bd400c3
commit
03e4eb4de8
@ -211,6 +211,10 @@ HISTORY
|
|||||||
|
|
||||||
++ Bugfixes:
|
++ Bugfixes:
|
||||||
|
|
||||||
|
2010-05-16: Simon Goldschmidt
|
||||||
|
* def.h/.c: changed the semantics of LWIP_PREFIX_BYTEORDER_FUNCS to prevent
|
||||||
|
"symbol already defined" i.e. when linking to winsock
|
||||||
|
|
||||||
2010-05-05: Simon Goldschmidt
|
2010-05-05: Simon Goldschmidt
|
||||||
* def.h, timers.c: Fixed bug #29769 (sys_check_timeouts: sys_now() may
|
* def.h, timers.c: Fixed bug #29769 (sys_check_timeouts: sys_now() may
|
||||||
overflow)
|
overflow)
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
* @return n in network byte order
|
* @return n in network byte order
|
||||||
*/
|
*/
|
||||||
u16_t
|
u16_t
|
||||||
htons(u16_t n)
|
lwip_htons(u16_t n)
|
||||||
{
|
{
|
||||||
return ((n & 0xff) << 8) | ((n & 0xff00) >> 8);
|
return ((n & 0xff) << 8) | ((n & 0xff00) >> 8);
|
||||||
}
|
}
|
||||||
@ -73,9 +73,9 @@ htons(u16_t n)
|
|||||||
* @return n in host byte order
|
* @return n in host byte order
|
||||||
*/
|
*/
|
||||||
u16_t
|
u16_t
|
||||||
ntohs(u16_t n)
|
lwip_ntohs(u16_t n)
|
||||||
{
|
{
|
||||||
return htons(n);
|
return lwip_htons(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -85,7 +85,7 @@ ntohs(u16_t n)
|
|||||||
* @return n in network byte order
|
* @return n in network byte order
|
||||||
*/
|
*/
|
||||||
u32_t
|
u32_t
|
||||||
htonl(u32_t n)
|
lwip_htonl(u32_t n)
|
||||||
{
|
{
|
||||||
return ((n & 0xff) << 24) |
|
return ((n & 0xff) << 24) |
|
||||||
((n & 0xff00) << 8) |
|
((n & 0xff00) << 8) |
|
||||||
@ -100,9 +100,9 @@ htonl(u32_t n)
|
|||||||
* @return n in host byte order
|
* @return n in host byte order
|
||||||
*/
|
*/
|
||||||
u32_t
|
u32_t
|
||||||
ntohl(u32_t n)
|
lwip_ntohl(u32_t n)
|
||||||
{
|
{
|
||||||
return htonl(n);
|
return lwip_htonl(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* (LWIP_PLATFORM_BYTESWAP == 0) && (BYTE_ORDER == LITTLE_ENDIAN) */
|
#endif /* (LWIP_PLATFORM_BYTESWAP == 0) && (BYTE_ORDER == LITTLE_ENDIAN) */
|
||||||
|
@ -58,6 +58,13 @@ extern "C" {
|
|||||||
#define LWIP_MAKE_U16(a, b) ((b << 8) | a)
|
#define LWIP_MAKE_U16(a, b) ((b << 8) | a)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef LWIP_PLATFORM_BYTESWAP
|
||||||
|
#define LWIP_PLATFORM_BYTESWAP 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef LWIP_PREFIX_BYTEORDER_FUNCS
|
||||||
|
/* workaround for naming collisions on some platforms */
|
||||||
|
|
||||||
#ifdef htons
|
#ifdef htons
|
||||||
#undef htons
|
#undef htons
|
||||||
#endif /* htons */
|
#endif /* htons */
|
||||||
@ -71,33 +78,28 @@ extern "C" {
|
|||||||
#undef ntohl
|
#undef ntohl
|
||||||
#endif /* ntohl */
|
#endif /* ntohl */
|
||||||
|
|
||||||
#ifndef LWIP_PLATFORM_BYTESWAP
|
#define htons(x) lwip_htons(x)
|
||||||
#define LWIP_PLATFORM_BYTESWAP 0
|
#define ntohs(x) lwip_ntohs(x)
|
||||||
#endif
|
#define htonl(x) lwip_htonl(x)
|
||||||
|
#define ntohl(x) lwip_ntohl(x)
|
||||||
|
#endif /* LWIP_PREFIX_BYTEORDER_FUNCS */
|
||||||
|
|
||||||
#if BYTE_ORDER == BIG_ENDIAN
|
#if BYTE_ORDER == BIG_ENDIAN
|
||||||
#define htons(x) (x)
|
#define lwip_htons(x) (x)
|
||||||
#define ntohs(x) (x)
|
#define lwip_ntohs(x) (x)
|
||||||
#define htonl(x) (x)
|
#define lwip_htonl(x) (x)
|
||||||
#define ntohl(x) (x)
|
#define lwip_ntohl(x) (x)
|
||||||
#else /* BYTE_ORDER != BIG_ENDIAN */
|
#else /* BYTE_ORDER != BIG_ENDIAN */
|
||||||
#ifdef LWIP_PREFIX_BYTEORDER_FUNCS
|
|
||||||
/* workaround for naming collisions on some platforms */
|
|
||||||
#define htons lwip_htons
|
|
||||||
#define ntohs lwip_ntohs
|
|
||||||
#define htonl lwip_htonl
|
|
||||||
#define ntohl lwip_ntohl
|
|
||||||
#endif /* LWIP_PREFIX_BYTEORDER_FUNCS */
|
|
||||||
#if LWIP_PLATFORM_BYTESWAP
|
#if LWIP_PLATFORM_BYTESWAP
|
||||||
#define htons(x) LWIP_PLATFORM_HTONS(x)
|
#define lwip_htons(x) LWIP_PLATFORM_HTONS(x)
|
||||||
#define ntohs(x) LWIP_PLATFORM_HTONS(x)
|
#define lwip_ntohs(x) LWIP_PLATFORM_HTONS(x)
|
||||||
#define htonl(x) LWIP_PLATFORM_HTONL(x)
|
#define lwip_htonl(x) LWIP_PLATFORM_HTONL(x)
|
||||||
#define ntohl(x) LWIP_PLATFORM_HTONL(x)
|
#define lwip_ntohl(x) LWIP_PLATFORM_HTONL(x)
|
||||||
#else /* LWIP_PLATFORM_BYTESWAP */
|
#else /* LWIP_PLATFORM_BYTESWAP */
|
||||||
u16_t htons(u16_t x);
|
u16_t lwip_htons(u16_t x);
|
||||||
u16_t ntohs(u16_t x);
|
u16_t lwip_ntohs(u16_t x);
|
||||||
u32_t htonl(u32_t x);
|
u32_t lwip_htonl(u32_t x);
|
||||||
u32_t ntohl(u32_t x);
|
u32_t lwip_ntohl(u32_t x);
|
||||||
#endif /* LWIP_PLATFORM_BYTESWAP */
|
#endif /* LWIP_PLATFORM_BYTESWAP */
|
||||||
|
|
||||||
#endif /* BYTE_ORDER == BIG_ENDIAN */
|
#endif /* BYTE_ORDER == BIG_ENDIAN */
|
||||||
|
Loading…
Reference in New Issue
Block a user