From: patthoyts <patthoyts>
Date: Fri, 13 Jun 2003 22:08:24 +0000 (+0000)
Subject: Cleaned up some -Wall warnings under unix.
X-Git-Tag: tcludp-1_0_5~2
X-Git-Url: http://www.privyetmir.co.uk/gitweb?a=commitdiff_plain;h=c3737982569ecec3537f1b8748e164c1d9151509;p=tcludp

Cleaned up some -Wall warnings under unix.
---

diff --git a/generic/udp_tcl.c b/generic/udp_tcl.c
index 1caec16..f2f7c30 100644
--- a/generic/udp_tcl.c
+++ b/generic/udp_tcl.c
@@ -417,12 +417,12 @@ udpPeek(ClientData clientData, Tcl_Interp *interp,
 {
 #ifndef WIN32
     int buffer_size = 16;
-    int actual_size, socksize, port;
+    int actual_size, socksize;
     int sock;
     char message[17];
-    char *remotehost;
-    struct hostent *name;
+    /*struct hostent *name;*/
 #ifdef SIPC_IPV6
+    char *remotehost;
     struct sockaddr_in6 recvaddr;
 #else
     struct sockaddr_in recvaddr;
diff --git a/generic/udp_tcl.h b/generic/udp_tcl.h
index 8ebdf08..5f7265c 100644
--- a/generic/udp_tcl.h
+++ b/generic/udp_tcl.h
@@ -13,13 +13,21 @@
 #define UDP_TCL_H
 
 #ifdef WIN32
-#include <winsock.h>
+#  include <winsock.h>
 #else
-#include <unistd.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <netinet/in.h>
-#include <netdb.h>
+#  if HAVE_UNISTD_H
+#    include <unistd.h>
+#  endif
+#  if HAVE_STDLIB_H
+#    include <stdlib.h>
+#  endif
+#  if HAVE_SYS_TIME_H
+#    include <sys/time.h>
+#  endif
+#  include <sys/socket.h>
+#  include <netinet/in.h>
+#  include <arpa/inet.h>
+#  include <netdb.h>
 #endif
 
 #include <stdio.h>