allow enabling socket API without (public) netconn API - netconn API is still used by sockets, but keeping it private (static) should allow better compiler optimizations

This commit is contained in:
sg
2015-01-17 14:42:50 +01:00
parent 69ee35c909
commit c1804810d8
9 changed files with 100 additions and 61 deletions

View File

@@ -59,6 +59,18 @@
#include <string.h>
/* If the netconn API is not required publicly, then we include the necessary
files here to get the implementation */
#if !LWIP_NETCONN
#undef LWIP_NETCONN
#define LWIP_NETCONN 1
#include "api_msg.c"
#include "api_lib.c"
#include "netbuf.c"
#undef LWIP_NETCONN
#define LWIP_NETCONN 0
#endif
#define IP4ADDR_PORT_TO_SOCKADDR(sin, ipXaddr, port) do { \
(sin)->sin_len = sizeof(struct sockaddr_in); \
(sin)->sin_family = AF_INET; \

View File

@@ -99,12 +99,12 @@ tcpip_thread(void *arg)
continue;
}
switch (msg->type) {
#if LWIP_NETCONN
#if LWIP_NETCONN || LWIP_SOCKET
case TCPIP_MSG_API:
LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_thread: API message %p\n", (void *)msg));
msg->msg.apimsg->function(&(msg->msg.apimsg->msg));
break;
#endif /* LWIP_NETCONN */
#endif /* LWIP_NETCONN || LWIP_SOCKET */
#if !LWIP_TCPIP_CORE_LOCKING_INPUT
case TCPIP_MSG_INPKT:
@@ -316,7 +316,7 @@ tcpip_untimeout(sys_timeout_handler h, void *arg)
}
#endif /* LWIP_TCPIP_TIMEOUT */
#if LWIP_NETCONN
#if LWIP_NETCONN || LWIP_SOCKET
/**
* Call the lower part of a netconn_* function
* This function is then running in the thread context
@@ -351,7 +351,7 @@ tcpip_apimsg(struct api_msg *apimsg)
return ERR_VAL;
}
#endif /* LWIP_NETCONN */
#endif /* LWIP_NETCONN || LWIP_SOCKET */
#if LWIP_NETIF_API
#if !LWIP_TCPIP_CORE_LOCKING