From 68f2db299d288c277b72e4e8abf496949b44cd35 Mon Sep 17 00:00:00 2001 From: Austin English Date: Thu, 29 Jan 2009 08:28:37 -0600 Subject: [PATCH] configure: Check for xinpgen struct. --- configure | 148 ++++++++++++++++++++++++++++++++++++++++ configure.ac | 24 +++++++ dlls/iphlpapi/ipstats.c | 6 +- include/config.h.in | 3 + 4 files changed, 178 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 6fd07c88295..b820d2d6613 100755 --- a/configure +++ b/configure @@ -20488,6 +20488,154 @@ _ACEOF fi +{ $as_echo "$as_me:$LINENO: checking for struct xinpgen" >&5 +$as_echo_n "checking for struct xinpgen... " >&6; } +if test "${ac_cv_type_struct_xinpgen+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_type_struct_xinpgen=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_SYS_SOCKETVAR_H +#include +#endif +#ifdef HAVE_NET_ROUTE_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN_SYSTM_H +#include +#endif +#ifdef HAVE_NETINET_IP_H +#include +#endif +#ifdef HAVE_NETINET_IN_PCB_H +#include +#endif + +int +main () +{ +if (sizeof (struct xinpgen)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_SYS_SOCKETVAR_H +#include +#endif +#ifdef HAVE_NET_ROUTE_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN_SYSTM_H +#include +#endif +#ifdef HAVE_NETINET_IP_H +#include +#endif +#ifdef HAVE_NETINET_IN_PCB_H +#include +#endif + +int +main () +{ +if (sizeof ((struct xinpgen))) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_struct_xinpgen=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_xinpgen" >&5 +$as_echo "$ac_cv_type_struct_xinpgen" >&6; } +if test "x$ac_cv_type_struct_xinpgen" = x""yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_XINPGEN 1 +_ACEOF + + +fi + + { $as_echo "$as_me:$LINENO: checking for struct ff_effect.direction" >&5 $as_echo_n "checking for struct ff_effect.direction... " >&6; } if test "${ac_cv_member_struct_ff_effect_direction+set}" = set; then diff --git a/configure.ac b/configure.ac index 8b78efeeeff..b0725c1c38f 100644 --- a/configure.ac +++ b/configure.ac @@ -1572,6 +1572,30 @@ AC_CHECK_TYPES([sigset_t],,,[#include #include ]) AC_CHECK_TYPES([request_sense],,,[#include ]) +AC_CHECK_TYPES([struct xinpgen],,, +[#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_SYS_SOCKETVAR_H +#include +#endif +#ifdef HAVE_NET_ROUTE_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN_SYSTM_H +#include +#endif +#ifdef HAVE_NETINET_IP_H +#include +#endif +#ifdef HAVE_NETINET_IN_PCB_H +#include +#endif]) + AC_CHECK_MEMBERS([struct ff_effect.direction],,, [#ifdef HAVE_LINUX_INPUT_H #include diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c index 75d4611a5db..31336f982d0 100644 --- a/dlls/iphlpapi/ipstats.c +++ b/dlls/iphlpapi/ipstats.c @@ -869,7 +869,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_STRUCT_XINPGEN) size_t Len = 0; char *Buf; struct xinpgen *pXIG, *pOrigXIG; @@ -1581,7 +1581,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_STRUCT_XINPGEN) size_t Len = 0; char *Buf; struct xinpgen *pXIG, *pOrigXIG; @@ -1615,7 +1615,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_STRUCT_XINPGEN) if (sysctlbyname ("net.inet.tcp.pcblist", NULL, &Len, NULL, 0) < 0) { diff --git a/include/config.h.in b/include/config.h.in index 11dc1c6b462..036b5fb87c2 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -780,6 +780,9 @@ /* Define to 1 if `st_mtim' is member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_MTIM +/* Define to 1 if the system has the type `struct xinpgen'. */ +#undef HAVE_STRUCT_XINPGEN + /* Define to 1 if you have the `symlink' function. */ #undef HAVE_SYMLINK