Fix compile on cygwin. This isnt the solution I would like: I would prefer to get pton and ntop to work even when AF_INET6 is not defined.

svn:r1326
This commit is contained in:
Nick Mathewson 2009-06-11 19:09:08 +00:00
parent bbd14de053
commit 01be8708e9
2 changed files with 10 additions and 2 deletions

View File

@ -644,7 +644,9 @@ evutil_parse_sockaddr_port(const char *ip_as_string, struct sockaddr *out, int *
if (!addr_part)
return -1; /* Should be impossible. */
if (is_ipv6) {
#ifdef AF_INET6
if (is_ipv6)
{
struct sockaddr_in6 sin6;
memset(&sin6, 0, sizeof(sin6));
#ifdef _EVENT_HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN
@ -660,7 +662,10 @@ evutil_parse_sockaddr_port(const char *ip_as_string, struct sockaddr *out, int *
memcpy(out, &sin6, sizeof(sin6));
*outlen = sizeof(sin6);
return 0;
} else {
}
else
#endif
{
struct sockaddr_in sin;
memset(&sin, 0, sizeof(sin));
#ifdef _EVENT_HAVE_STRUCT_SOCKADDR_IN_SIN_LEN

View File

@ -31,6 +31,9 @@
#define _EVENT_IPV6_INTERNAL_H
#include <sys/types.h>
#ifdef _EVENT_HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#include "event-config.h"
#include <event2/util.h>