Include <sys/time.h> and <unistd.h> inside HAVE_x_H.
authorGisle Vanem <gvanem@broadpark.no>
Tue, 6 Feb 2007 18:56:34 +0000 (18:56 +0000)
committerGisle Vanem <gvanem@broadpark.no>
Tue, 6 Feb 2007 18:56:34 +0000 (18:56 +0000)
Added 'optind' and 'optarg' as in adig.c.

ahost.c

diff --git a/ahost.c b/ahost.c
index 55d47a416f4ab5bd259e1dc8df810f7742d17990..8f6b671afc69040bf012d992e6c4bfb0f899ffe2 100644 (file)
--- a/ahost.c
+++ b/ahost.c
 #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>
 #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