summaryrefslogtreecommitdiff
path: root/ahost.c
diff options
context:
space:
mode:
authorGisle Vanem <gvanem@broadpark.no>2007-02-06 18:56:34 +0000
committerGisle Vanem <gvanem@broadpark.no>2007-02-06 18:56:34 +0000
commit54d532074505c5560738c038c6e014313e2dd398 (patch)
tree4a2112a9bafc3d226cded1fd6f48784d51e9d965 /ahost.c
parent7ac09a058c85c07755123c493bc7a9652a12020f (diff)
downloadc-ares-54d532074505c5560738c038c6e014313e2dd398.tar.gz
c-ares-54d532074505c5560738c038c6e014313e2dd398.tar.bz2
c-ares-54d532074505c5560738c038c6e014313e2dd398.zip
Include <sys/time.h> and <unistd.h> inside HAVE_x_H.
Added 'optind' and 'optarg' as in adig.c.
Diffstat (limited to 'ahost.c')
-rw-r--r--ahost.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ahost.c b/ahost.c
index 55d47a4..8f6b671 100644
--- a/ahost.c
+++ b/ahost.c
@@ -19,13 +19,17 @@
#include <sys/types.h>
#if !defined(WIN32) || defined(WATT32)
+#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
+#endif
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
+#endif
#include <stdio.h>
#include <stdlib.h>
@@ -40,6 +44,11 @@
#include "inet_ntop.h"
#include "inet_net_pton.h"
+#ifndef optind
+extern int optind;
+extern char *optarg;
+#endif
+
#ifndef INADDR_NONE
#define INADDR_NONE 0xffffffff
#endif