From 47d8d69b81b43e08814ecea6eaf247d628b9e115 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Sun, 2 Dec 2007 15:24:02 +0000 Subject: [PATCH] fix bug #21654: exclude definition of struct timeval from #ifndef FD_SET. If including for system-struct timeval, LWIP_TIMEVAL_PRIVATE now has to be set to 0 in lwipopts.h --- CHANGELOG | 5 +++++ src/include/lwip/sockets.h | 18 ++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index df9d1906..f601dd33 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -508,6 +508,11 @@ HISTORY ++ Bug fixes: + 2007-12-02 Simon Goldschmidt + * sockets.h: fix bug #21654: exclude definition of struct timeval from #ifndef FD_SET + If including for system-struct timeval, LWIP_TIMEVAL_PRIVATE now + has to be set to 0 in lwipopts.h + 2007-12-02 Simon Goldschmidt * api_msg.c, api_lib.c: fix bug #21656 (recvmbox problem in netconn API): always allocate a recvmbox in netconn_new_with_proto_and_callback. For a tcp-listen diff --git a/src/include/lwip/sockets.h b/src/include/lwip/sockets.h index 749f5122..603b62fd 100644 --- a/src/include/lwip/sockets.h +++ b/src/include/lwip/sockets.h @@ -261,23 +261,21 @@ typedef struct ip_mreq { 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 - */ +#endif /* FD_SET */ + +/** LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided + * by your system, set this to 0 and include in cc.h */ #ifndef LWIP_TIMEVAL_PRIVATE #define LWIP_TIMEVAL_PRIVATE 1 #endif #if LWIP_TIMEVAL_PRIVATE - struct timeval { - long tv_sec; /* seconds */ - long tv_usec; /* and microseconds */ - }; +struct timeval { + long tv_sec; /* seconds */ + long tv_usec; /* and microseconds */ +}; #endif /* LWIP_TIMEVAL_PRIVATE */ -#endif /* FD_SET */ - void lwip_socket_init(void); int lwip_accept(int s, struct sockaddr *addr, socklen_t *addrlen);