configure.ac: check for xinpgen struct (2/2)

Austin English austinenglish at gmail.com
Thu Jan 29 08:28:37 CST 2009


netinet/in_pcb.h doesn't have this defined on NetBSD, causing lots of
strange errors. Okayed by Juan (original author).

These two patches finally fix the compile (aside from some signed char
warnings) in iphlpapi on NetBSD!

-- 
-Austin
-------------- next part --------------
diff --git a/configure.ac b/configure.ac
index 06e3678..112173a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1569,6 +1569,30 @@ AC_CHECK_TYPES([sigset_t],,,[#include <sys/types.h>
 #include <signal.h>])
 AC_CHECK_TYPES([request_sense],,,[#include <linux/cdrom.h>])
 
+AC_CHECK_TYPES([xinpgen],,,
+[#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_SOCKETVAR_H
+#include <sys/socketvar.h>
+#endif
+#ifdef HAVE_NET_ROUTE_H
+#include <net/route.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
+#ifdef HAVE_NETINET_IP_H
+#include <netinet/ip.h>
+#endif
+#ifdef HAVE_NETINET_IN_PCB_H
+#include <netinet/in_pcb.h>
+#endif])
+
 AC_CHECK_MEMBERS([struct ff_effect.direction],,,
 [#ifdef HAVE_LINUX_INPUT_H
 #include <linux/input.h>
diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c
index 6d3c413..06e6b92 100644
--- a/dlls/iphlpapi/ipstats.c
+++ b/dlls/iphlpapi/ipstats.c
@@ -865,7 +865,7 @@ DWORD getUDPStats(MIB_UDPSTATS *stats)
 
 static DWORD getNumWithOneHeader(const char *filename)
 {
-#if defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_NETINET_IN_PCB_H)
+#if defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_XINPGEN)
    size_t Len = 0;
    char *Buf;
    struct xinpgen *pXIG, *pOrigXIG;
@@ -1577,7 +1577,7 @@ DWORD getTcpTable(PMIB_TCPTABLE *ppTcpTable, DWORD maxEntries, HANDLE heap,
 {
    DWORD numEntries;
    PMIB_TCPTABLE table;
-#if defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_NETINET_IN_PCB_H)
+#if defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_XINPGEN)
    size_t Len = 0;
    char *Buf;
    struct xinpgen *pXIG, *pOrigXIG;
@@ -1611,7 +1611,7 @@ DWORD getTcpTable(PMIB_TCPTABLE *ppTcpTable, DWORD maxEntries, HANDLE heap,
    if (!numEntries)
       return NO_ERROR;
 
-#if defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_NETINET_IN_PCB_H)
+#if defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_XINPGEN)
 
    if (sysctlbyname ("net.inet.tcp.pcblist", NULL, &Len, NULL, 0) < 0)
    {
-- 
1.6.0.2


More information about the wine-patches mailing list