=?UTF-8?Q?Andr=C3=A9=20Hentschel=20?=: iphlpapi: Check for struct udpstat ( for NetBSD).

Alexandre Julliard julliard at winehq.org
Fri Jun 8 13:36:13 CDT 2012


Module: wine
Branch: master
Commit: 20dbe9121258bcabccf67993e3ae1c65a555623a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=20dbe9121258bcabccf67993e3ae1c65a555623a

Author: André Hentschel <nerv at dawncrow.de>
Date:   Thu Jun  7 17:19:49 2012 +0200

iphlpapi: Check for struct udpstat (for NetBSD).

---

 configure               |   14 ++++++++++++++
 configure.ac            |    6 ++++++
 dlls/iphlpapi/ipstats.c |    2 +-
 include/config.h.in     |    3 +++
 4 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/configure b/configure
index a6536b2..d9e1d65 100755
--- a/configure
+++ b/configure
@@ -14128,6 +14128,20 @@ _ACEOF
 fi
 
 
+ac_fn_c_check_member "$LINENO" "struct udpstat" "udps_ipackets" "ac_cv_member_struct_udpstat_udps_ipackets" "#ifdef HAVE_NETINET_UDP_VAR_H
+#include <netinet/udp_var.h>
+#endif
+"
+if test "x$ac_cv_member_struct_udpstat_udps_ipackets" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_UDPSTAT_UDPS_IPACKETS 1
+_ACEOF
+
+
+fi
+
+
 ac_fn_c_check_member "$LINENO" "struct ifreq" "ifr_hwaddr" "ac_cv_member_struct_ifreq_ifr_hwaddr" "#ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
diff --git a/configure.ac b/configure.ac
index 46e448e..c92c326 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2342,6 +2342,12 @@ AC_CHECK_MEMBERS([struct tcp_stats.tcps_connattempt],,,
 #include <netinet/tcp_var.h>
 #endif])
 
+dnl Check for struct udpstat
+AC_CHECK_MEMBERS([struct udpstat.udps_ipackets],,,
+[#ifdef HAVE_NETINET_UDP_VAR_H
+#include <netinet/udp_var.h>
+#endif])
+
 dnl Check for struct ifreq.ifr_hwaddr
 AC_CHECK_MEMBERS([struct ifreq.ifr_hwaddr],,,
 [#ifdef HAVE_SYS_TYPES_H
diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c
index 41cb779..285e700 100644
--- a/dlls/iphlpapi/ipstats.c
+++ b/dlls/iphlpapi/ipstats.c
@@ -927,7 +927,7 @@ DWORD WINAPI GetUdpStatistics(PMIB_UDPSTATS stats)
         }
         if (kc) kstat_close( kc );
     }
-#elif defined(HAVE_SYS_SYSCTL_H) && defined(UDPCTL_STATS)
+#elif defined(HAVE_SYS_SYSCTL_H) && defined(UDPCTL_STATS) && defined(HAVE_STRUCT_UDPSTAT_UDPS_IPACKETS)
     {
         int mib[] = {CTL_NET, PF_INET, IPPROTO_UDP, UDPCTL_STATS};
 #define MIB_LEN (sizeof(mib) / sizeof(mib[0]))
diff --git a/include/config.h.in b/include/config.h.in
index 7d6e261..20a0be3 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -866,6 +866,9 @@
 /* Define to 1 if `tcps_connattempt' is a member of `struct tcp_stats'. */
 #undef HAVE_STRUCT_TCP_STATS_TCPS_CONNATTEMPT
 
+/* Define to 1 if `udps_ipackets' is a member of `struct udpstat'. */
+#undef HAVE_STRUCT_UDPSTAT_UDPS_IPACKETS
+
 /* Define to 1 if the system has the type `struct xinpgen'. */
 #undef HAVE_STRUCT_XINPGEN
 




More information about the wine-cvs mailing list