diff --git a/src/api/sockets.c b/src/api/sockets.c index e3ab4df3..7c636c64 100644 --- a/src/api/sockets.c +++ b/src/api/sockets.c @@ -37,6 +37,7 @@ #include "lwip/arch.h" #include "lwip/sys.h" +#define LWIP_TIMEVAL_PRIVATE #include "lwip/sockets.h" #define NUM_SOCKETS MEMP_NUM_NETCONN diff --git a/src/include/lwip/sockets.h b/src/include/lwip/sockets.h index e2d23db1..7e8172cc 100644 --- a/src/include/lwip/sockets.h +++ b/src/include/lwip/sockets.h @@ -205,10 +205,16 @@ struct linger { unsigned char fd_bits [(FD_SETSIZE+7)/8]; } fd_set; +/* + * only define this in sockets.c so it does not interfere + * with other projects namespaces where timeval is present + */ +#ifdef LWIP_TIMEVAL_PRIVATE struct timeval { long tv_sec; /* seconds */ long tv_usec; /* and microseconds */ }; +#endif #endif