Backport: Define socklen_t before using it in compat.h

svn:r17445
This commit is contained in:
Nick Mathewson 2008-12-02 18:56:15 +00:00
parent 7e1123bd7e
commit 0d091964dd
2 changed files with 5 additions and 4 deletions

View File

@ -3,6 +3,7 @@ Changes in version 0.2.0.33 - 200?-??-??
- 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

View File

@ -271,6 +271,10 @@ int touch_file(const char *fname);
/* ===== 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 @@ int get_n_open_sockets(void);
#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