[or-cvs] r17445: {tor} Backport: Define socklen_t before using it in compat.h (in tor/branches/tor-0_2_0-patches: . src/common)

nickm at seul.org nickm at seul.org
Tue Dec 2 18:56:15 UTC 2008


Author: nickm
Date: 2008-12-02 13:56:15 -0500 (Tue, 02 Dec 2008)
New Revision: 17445

Modified:
   tor/branches/tor-0_2_0-patches/ChangeLog
   tor/branches/tor-0_2_0-patches/src/common/compat.h
Log:
Backport: Define socklen_t before using it in compat.h

Modified: tor/branches/tor-0_2_0-patches/ChangeLog
===================================================================
--- tor/branches/tor-0_2_0-patches/ChangeLog	2008-12-02 18:54:47 UTC (rev 17444)
+++ tor/branches/tor-0_2_0-patches/ChangeLog	2008-12-02 18:56:15 UTC (rev 17445)
@@ -3,6 +3,7 @@
     - Do not mark smartlist_bsearch_idx() function as ATTR_PURE.  This bug
       could make gcc generate non-functional binary search code. Bugfix
       on 0.2.0.10-alpha.
+    - Build correctly on platforms without socklen_t.
 
 
 Changes in version 0.2.0.32 - 2008-11-20

Modified: tor/branches/tor-0_2_0-patches/src/common/compat.h
===================================================================
--- tor/branches/tor-0_2_0-patches/src/common/compat.h	2008-12-02 18:54:47 UTC (rev 17444)
+++ tor/branches/tor-0_2_0-patches/src/common/compat.h	2008-12-02 18:56:15 UTC (rev 17445)
@@ -271,6 +271,10 @@
 
 /* ===== Net compatibility */
 
+#if (SIZEOF_SOCKLEN_T == 0)
+typedef int socklen_t;
+#endif
+
 int tor_close_socket(int s);
 int tor_open_socket(int domain, int type, int protocol);
 int tor_accept_socket(int sockfd, struct sockaddr *addr, socklen_t *len);
@@ -284,10 +288,6 @@
 #define tor_socket_recv(s, buf, len, flags) recv(s, buf, len, flags)
 #endif
 
-#if (SIZEOF_SOCKLEN_T == 0)
-typedef int socklen_t;
-#endif
-
 /* Define struct in6_addr on platforms that do not have it.  Generally,
  * these platforms are ones without IPv6 support, but we want to have
  * a working in6_addr there anyway, so we can use it to parse IPv6



More information about the tor-commits mailing list