]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lwip.git/commitdiff
fix bug #21654: exclude definition of struct timeval from #ifndef FD_SET. If includin...
authorgoldsimon <goldsimon>
Sun, 2 Dec 2007 15:24:02 +0000 (15:24 +0000)
committergoldsimon <goldsimon>
Sun, 2 Dec 2007 15:24:02 +0000 (15:24 +0000)
CHANGELOG
src/include/lwip/sockets.h

index df9d19062ed38df57d48d39f06c4e0a7addcfa11..f601dd33b5871dd236243ce5c3e9b8a5d6a2f4c8 100644 (file)
--- 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 <sys/time.h> 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
index 749f512216fb8251a8bd4f126ceba95f7550f887..603b62fdc2663c0ea9fd43e6764fe20a8eb2f87b 100644 (file)
@@ -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 <sys/time.h> 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);