diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-04-22 11:31:06 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-11-04 11:02:10 +0100 |
commit | 6fd304e5e6c8b386d3671f4932a74124fd37192a (patch) | |
tree | 0110c5339a4fe42276017f1fd74373baa1e25f22 /src/resolver.c | |
parent | d3018bfbb5f5712e6fe0f7ce534a362a0518d2c2 (diff) |
Switch from autotools to a custom build system adapted from Libav.
Diffstat (limited to 'src/resolver.c')
-rw-r--r-- | src/resolver.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/resolver.c b/src/resolver.c index 243b7cd0..3ab0a50e 100644 --- a/src/resolver.c +++ b/src/resolver.c @@ -20,13 +20,13 @@ #include "config.h" #include "resolver.h" -#ifndef G_OS_WIN32 -#include <sys/socket.h> -#include <netdb.h> -#else /* G_OS_WIN32 */ +#if HAVE_WINSOCK2_H #include <ws2tcpip.h> #include <winsock.h> -#endif /* G_OS_WIN32 */ +#else +#include <sys/socket.h> +#include <netdb.h> +#endif #include <string.h> @@ -38,7 +38,7 @@ sockaddr_to_string(const struct sockaddr *sa, size_t length, GError **error) struct sockaddr_in a4; #endif int ret; - char host[NI_MAXHOST], serv[NI_MAXSERV]; + char host[1024], serv[1024]; #if defined(HAVE_IPV6) && defined(IN6_IS_ADDR_V4MAPPED) if (sa->sa_family == AF_INET6 && @@ -64,14 +64,14 @@ sockaddr_to_string(const struct sockaddr *sa, size_t length, GError **error) return NULL; } -#ifdef HAVE_UN +#if HAVE_UN if (sa->sa_family == AF_UNIX) /* "serv" contains corrupt information with unix sockets */ return g_strdup(host); #endif -#ifdef HAVE_IPV6 +#if HAVE_IPV6 if (strchr(host, ':') != NULL) return g_strconcat("[", host, "]:", serv, NULL); #endif |