Fix bug #50932: LWIP-provided byteorder functions defined in the wrong scope

Apply suggested fix from "Fayek"
(cherry picked from commit fe8c62e7b6)
This commit is contained in:
Dirk Ziegelmeier 2017-05-03 22:28:46 +02:00 committed by goldsimon
parent f389d78f7e
commit c6b19cad34

View File

@ -91,14 +91,6 @@ u32_t lwip_htonl(u32_t x);
#endif
#define lwip_ntohl(x) lwip_htonl(x)
/* Provide usual function names as macros for users, but this can be turned off */
#ifndef LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS
#define htons(x) lwip_htons(x)
#define ntohs(x) lwip_ntohs(x)
#define htonl(x) lwip_htonl(x)
#define ntohl(x) lwip_ntohl(x)
#endif
/* These macros should be calculated by the preprocessor and are used
with compile-time constants only (so that there is no little-endian
overhead at runtime). */
@ -109,9 +101,16 @@ u32_t lwip_htonl(u32_t x);
(((x) & 0x00ff0000UL) >> 8) | \
(((x) & 0xff000000UL) >> 24))
#define PP_NTOHL(x) PP_HTONL(x)
#endif /* BYTE_ORDER == BIG_ENDIAN */
/* Provide usual function names as macros for users, but this can be turned off */
#ifndef LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS
#define htons(x) lwip_htons(x)
#define ntohs(x) lwip_ntohs(x)
#define htonl(x) lwip_htonl(x)
#define ntohl(x) lwip_ntohl(x)
#endif
/* Functions that are not available as standard implementations.
* In cc.h, you can #define these to implementations available on
* your platform to save some code bytes if you use these functions