aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-04-06 14:11:50 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-04-06 14:11:50 +0000
commitba26c3fb2252d23f9287b659569698476a06abcf (patch)
tree65988e9fda49ad93f1f3ba8ff64e96896ac642dc
parent41563607a841bd1a34bc484486502ce48b6f94e7 (diff)
check for struct sizes and use those sizes if the NS_* defines are lacking
(IRIX 6.5.22 it seems)
-rw-r--r--ares/configure.ac34
-rw-r--r--ares/inet_net_pton.h12
2 files changed, 46 insertions, 0 deletions
diff --git a/ares/configure.ac b/ares/configure.ac
index ca8bb6add..c163d1fe6 100644
--- a/ares/configure.ac
+++ b/ares/configure.ac
@@ -188,4 +188,38 @@ int main()
], AC_MSG_RESULT(no),AC_MSG_RESULT(no))
fi
+AC_CHECK_SIZEOF(struct in6_addr, ,
+[
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+]
+)
+AC_CHECK_SIZEOF(struct in_addr, ,
+[
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+]
+)
+
+
AC_OUTPUT(Makefile)
diff --git a/ares/inet_net_pton.h b/ares/inet_net_pton.h
index 5e0820814..a7b407458 100644
--- a/ares/inet_net_pton.h
+++ b/ares/inet_net_pton.h
@@ -39,4 +39,16 @@ int ares_inet_pton(int af, const char *src, void *dst);
int ares_inet_net_pton(int af, const char *src, void *dst, size_t size);
#endif
+#ifndef NS_IN6ADDRSZ
+#define NS_IN6ADDRSZ SIZEOF_STRUCT_IN6_ADDR
+#endif
+
+#ifndef NS_INADDRSZ
+#define NS_INADDRSZ SIZEOF_STRUCT_IN_ADDR
+#endif
+
+#ifndef NS_INT16SZ
+#define NS_INT16SZ 2
+#endif
+
#endif /* INET_NET_PTON_H */