mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-04 23:29:25 +00:00
Fix bug #54850: lwip definition of htonX and ntohX do not properly cast to unsigned when byte order is Big Endian
Changes suggested by Ivan Warren
This commit is contained in:
parent
c2892ed0fb
commit
ee269ceec5
@ -83,14 +83,14 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#if BYTE_ORDER == BIG_ENDIAN
|
||||
#define lwip_htons(x) (x)
|
||||
#define lwip_ntohs(x) (x)
|
||||
#define lwip_htonl(x) (x)
|
||||
#define lwip_ntohl(x) (x)
|
||||
#define PP_HTONS(x) (x)
|
||||
#define PP_NTOHS(x) (x)
|
||||
#define PP_HTONL(x) (x)
|
||||
#define PP_NTOHL(x) (x)
|
||||
#define lwip_htons(x) ((u16_t)(x))
|
||||
#define lwip_ntohs(x) ((u16_t)(x))
|
||||
#define lwip_htonl(x) ((u32_t)(x))
|
||||
#define lwip_ntohl(x) ((u32_t)(x))
|
||||
#define PP_HTONS(x) ((u16_t)(x))
|
||||
#define PP_NTOHS(x) ((u16_t)(x))
|
||||
#define PP_HTONL(x) ((u32_t)(x))
|
||||
#define PP_NTOHL(x) ((u32_t)(x))
|
||||
#else /* BYTE_ORDER != BIG_ENDIAN */
|
||||
#ifndef lwip_htons
|
||||
u16_t lwip_htons(u16_t x);
|
||||
|
Loading…
Reference in New Issue
Block a user