diff libpurple/nat-pmp.c @ 16919:d0e74d0be43f

I expanded your patch, Richard, to also do appropriate header checking in the configure script and then use that information. I removed some other #includes which don't appear to be needed. committer: Richard Laager <rlaager@wiktel.com>
author Evan Schoenberg <evan.s@dreskin.net>
date Sat, 05 May 2007 16:48:06 +0000
parents 533ebd404184
children db6218615be4
line wrap: on
line diff
--- a/libpurple/nat-pmp.c	Sat May 05 14:50:00 2007 +0000
+++ b/libpurple/nat-pmp.c	Sat May 05 16:48:06 2007 +0000
@@ -29,30 +29,25 @@
  */
 
 #include "nat-pmp.h"
+#include "internal.h"
 #include "debug.h"
 #include "signals.h"
 #include "network.h"
 
-#include <sys/types.h>
-#ifndef _WIN32
-#include <arpa/inet.h>
-#include <netinet/in.h>
-#include <sys/socket.h>
+#ifdef HAVE_SYS_SYSCTL_H
 #include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/route.h>
-
-#include <netdb.h>
 #endif
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
 
-#include <errno.h>
+/* We will need sysctl() and NET_RT_DUMP, both of which are not present
+ * on all platforms, to continue. */
+#if defined(HAVE_SYS_SYSCTL_H) && defined(NET_RT_DUMP)
 
-#ifdef NET_RT_DUMP
+#include <sys/types.h>
+#include <net/route.h>
 
 #define PMP_DEBUG	1
 
@@ -548,4 +543,4 @@
 {
 
 }
-#endif /* #ifndef NET_RT_DUMP */
+#endif /* #if !(defined(HAVE_SYS_SYCTL_H) && defined(NET_RT_DUMP)) */