aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2007-11-15 19:44:01 +0000
committerYang Tse <yangsita@gmail.com>2007-11-15 19:44:01 +0000
commitca95f58ac0d5c9cc8f56517917af8b83248777f7 (patch)
treeb8dc0e3d9ef21e7fdc85404d42e858822101e381
parented636cbe4482e20bee084f2f83df494babb4defd (diff)
Needed now that in6_addr is referenced in ares.h
-rw-r--r--ares/ahost.c7
-rw-r--r--ares/ares.h17
-rw-r--r--ares/ares_ipv6.h10
-rw-r--r--ares/ares_parse_a_reply.c1
-rw-r--r--ares/ares_parse_aaaa_reply.c1
-rw-r--r--ares/config-win32.h10
-rw-r--r--ares/nameser.h3
7 files changed, 33 insertions, 16 deletions
diff --git a/ares/ahost.c b/ares/ahost.c
index 1e6cc8bd4..974f94d68 100644
--- a/ares/ahost.c
+++ b/ares/ahost.c
@@ -40,13 +40,6 @@
#include "inet_net_pton.h"
#include "ares_getopt.h"
-#ifndef HAVE_STRUCT_IN6_ADDR
-struct in6_addr
-{
- unsigned char s6_addr[16];
-};
-#endif
-
static void callback(void *arg, int status, int timeouts, struct hostent *host);
static void usage(void);
diff --git a/ares/ares.h b/ares/ares.h
index 5e3431010..37ad9b95c 100644
--- a/ares/ares.h
+++ b/ares/ares.h
@@ -43,8 +43,12 @@
#include <sys/socket.h>
#include <tcp.h>
#elif defined(WIN32)
- #include <winsock2.h>
- #include <windows.h>
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif
+# include <windows.h>
+# include <winsock2.h>
+# include <ws2tcpip.h>
#else
#include <netinet/in.h>
#include <sys/socket.h>
@@ -241,6 +245,15 @@ int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf,
int ares_expand_string(const unsigned char *encoded, const unsigned char *abuf,
int alen, unsigned char **s, long *enclen);
+#ifndef s6_addr
+struct in6_addr {
+ union {
+ unsigned char _S6_u8[16];
+ } _S6_un;
+};
+#define s6_addr _S6_un._S6_u8
+#endif
+
struct addrttl {
struct in_addr ipaddr;
int ttl;
diff --git a/ares/ares_ipv6.h b/ares/ares_ipv6.h
index afc98320b..6ffa2f375 100644
--- a/ares/ares_ipv6.h
+++ b/ares/ares_ipv6.h
@@ -21,11 +21,13 @@
#define PF_INET6 AF_INET6
#endif
-#ifndef HAVE_STRUCT_IN6_ADDR
-struct in6_addr
-{
- unsigned char s6_addr[16];
+#ifndef s6_addr
+struct in6_addr {
+ union {
+ unsigned char _S6_u8[16];
+ } _S6_un;
};
+#define s6_addr _S6_un._S6_u8
#endif
#ifndef HAVE_STRUCT_SOCKADDR_IN6
diff --git a/ares/ares_parse_a_reply.c b/ares/ares_parse_a_reply.c
index 4dea80eae..34f2d67e0 100644
--- a/ares/ares_parse_a_reply.c
+++ b/ares/ares_parse_a_reply.c
@@ -32,6 +32,7 @@
#include <stdlib.h>
#include <string.h>
+#include <limits.h>
#include "ares.h"
#include "ares_dns.h"
#include "ares_private.h"
diff --git a/ares/ares_parse_aaaa_reply.c b/ares/ares_parse_aaaa_reply.c
index 3b578f151..656ffbfb0 100644
--- a/ares/ares_parse_aaaa_reply.c
+++ b/ares/ares_parse_aaaa_reply.c
@@ -34,6 +34,7 @@
#include <stdlib.h>
#include <string.h>
+#include <limits.h>
#include "ares.h"
#include "ares_dns.h"
#include "inet_net_pton.h"
diff --git a/ares/config-win32.h b/ares/config-win32.h
index 1b65ce764..257a98451 100644
--- a/ares/config-win32.h
+++ b/ares/config-win32.h
@@ -174,19 +174,29 @@
/* ---------------------------------------------------------------- */
/* Define this if you have address family AF_INET6 */
+#ifdef HAVE_WINSOCK2_H
#define HAVE_AF_INET6 1
+#endif
/* Define this if you have protocol family PF_INET6 */
+#ifdef HAVE_WINSOCK2_H
#define HAVE_PF_INET6 1
+#endif
/* Define this if you have struct in6_addr */
+#ifdef HAVE_WS2TCPIP_H
#define HAVE_STRUCT_IN6_ADDR 1
+#endif
/* Define this if you have struct sockaddr_in6 */
+#ifdef HAVE_WS2TCPIP_H
#define HAVE_STRUCT_SOCKADDR_IN6 1
+#endif
/* Define this if you have sockaddr_in6 with scopeid */
+#ifdef HAVE_WS2TCPIP_H
#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
+#endif
#endif /* __ARES_CONFIG_WIN32_H */
diff --git a/ares/nameser.h b/ares/nameser.h
index 61741bb5f..154941450 100644
--- a/ares/nameser.h
+++ b/ares/nameser.h
@@ -7,9 +7,6 @@
port build */
#ifndef NETWARE
-#ifndef __CYGWIN__
-#include <windows.h>
-#endif
#include <process.h> /* for the _getpid() proto */
#endif /* !NETWARE */
#include <sys/types.h>