sockets: convert _HAVE_SA_LEN to lwip style

This commit is contained in:
Simon Goldschmidt 2019-08-01 21:04:06 +02:00
parent f126750ccd
commit 602a66fe58
2 changed files with 6 additions and 8 deletions

View File

@ -85,14 +85,12 @@
#define API_SELECT_CB_VAR_ALLOC(name, retblock) API_VAR_ALLOC_EXT(struct lwip_select_cb, MEMP_SELECT_CB, name, retblock) #define API_SELECT_CB_VAR_ALLOC(name, retblock) API_VAR_ALLOC_EXT(struct lwip_select_cb, MEMP_SELECT_CB, name, retblock)
#define API_SELECT_CB_VAR_FREE(name) API_VAR_FREE(MEMP_SELECT_CB, name) #define API_SELECT_CB_VAR_FREE(name) API_VAR_FREE(MEMP_SELECT_CB, name)
#ifdef _HAVE_SA_LEN #ifndef LWIP_SOCKET_HAVE_SA_LEN
#define HAVE_SA_LEN _HAVE_SA_LEN #define LWIP_SOCKET_HAVE_SA_LEN 0
#else #endif /* LWIP_SOCKET_HAVE_SA_LEN */
#define HAVE_SA_LEN 0
#endif /* _HAVE_SA_LEN */
/* Address length safe read and write */ /* Address length safe read and write */
#if HAVE_SA_LEN #if LWIP_SOCKET_HAVE_SA_LEN
#if LWIP_IPV4 #if LWIP_IPV4
#define IP4ADDR_SOCKADDR_SET_LEN(sin) \ #define IP4ADDR_SOCKADDR_SET_LEN(sin) \
@ -129,7 +127,7 @@
#define IPADDR_SOCKADDR_GET_LEN(addr) sizeof(struct sockaddr) #define IPADDR_SOCKADDR_GET_LEN(addr) sizeof(struct sockaddr)
#endif /* LWIP_IPV4 && LWIP_IPV6 */ #endif /* LWIP_IPV4 && LWIP_IPV6 */
#endif /* HAVE_SA_LEN */ #endif /* LWIP_SOCKET_HAVE_SA_LEN */
#if LWIP_IPV4 #if LWIP_IPV4
#define IP4ADDR_PORT_TO_SOCKADDR(sin, ipaddr, port) do { \ #define IP4ADDR_PORT_TO_SOCKADDR(sin, ipaddr, port) do { \

View File

@ -60,7 +60,7 @@ extern "C" {
#endif #endif
/* sockaddr and pals include length fields */ /* sockaddr and pals include length fields */
#define _HAVE_SA_LEN 1 #define LWIP_SOCKET_HAVE_SA_LEN 1
/* If your port already typedef's sa_family_t, define SA_FAMILY_T_DEFINED /* If your port already typedef's sa_family_t, define SA_FAMILY_T_DEFINED
to prevent this code from redefining it. */ to prevent this code from redefining it. */