mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
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:
parent
bbd14de053
commit
01be8708e9
9
evutil.c
9
evutil.c
@ -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
|
||||
|
@ -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>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user