# HG changeset patch # User Evan Schoenberg # Date 1178383686 0 # Node ID d0e74d0be43fe13ba24d4919482f4ab66705cfac # Parent 533ebd404184f0c8726edc0eea97fc1c35bdc2f5 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 diff -r 533ebd404184 -r d0e74d0be43f configure.ac --- a/configure.ac Sat May 05 14:50:00 2007 +0000 +++ b/configure.ac Sat May 05 16:48:06 2007 +0000 @@ -1922,6 +1922,7 @@ AC_CHECK_HEADERS(sys/file.h sys/filio.h sys/ioctl.h sys/msgbuf.h) AC_CHECK_HEADERS(sys/select.h sys/uio.h sys/utsname.h sys/wait.h) AC_CHECK_HEADERS(termios.h) +AC_CHECK_HEADERS(sys/sysctl.h sys/socket.h) AC_VAR_TIMEZONE_EXTERNALS AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff, diff -r 533ebd404184 -r d0e74d0be43f libpurple/nat-pmp.c --- 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 -#ifndef _WIN32 -#include -#include -#include +#ifdef HAVE_SYS_SYSCTL_H #include - -#include -#include - -#include #endif -#include -#include -#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif -#include +/* 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 +#include #define PMP_DEBUG 1 @@ -548,4 +543,4 @@ { } -#endif /* #ifndef NET_RT_DUMP */ +#endif /* #if !(defined(HAVE_SYS_SYCTL_H) && defined(NET_RT_DUMP)) */