Juan Lang : iphlpapi: Check for ifr_hwaddr member of struct ifreq.

Alexandre Julliard julliard at winehq.org
Mon Mar 15 12:19:32 CDT 2010


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

Author: Juan Lang <juan.lang at gmail.com>
Date:   Fri Mar 12 10:38:46 2010 -0800

iphlpapi: Check for ifr_hwaddr member of struct ifreq.

---

 configure              |   17 +++++++++++++++++
 configure.ac           |    9 +++++++++
 dlls/iphlpapi/ifenum.c |    2 +-
 include/config.h.in    |    3 +++
 4 files changed, 30 insertions(+), 1 deletions(-)

diff --git a/configure b/configure
index 3807a70..f3eec77 100755
--- a/configure
+++ b/configure
@@ -13429,6 +13429,23 @@ _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
+#ifdef HAVE_NET_IF_H
+# include <net/if.h>
+#endif
+"
+if test "x$ac_cv_member_struct_ifreq_ifr_hwaddr" = x""yes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_IFREQ_IFR_HWADDR 1
+_ACEOF
+
+
+fi
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for timezone variable" >&5
 $as_echo_n "checking for timezone variable... " >&6; }
 if test "${ac_cv_have_timezone+set}" = set; then :
diff --git a/configure.ac b/configure.ac
index 8eb37a2..e3787eb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2047,6 +2047,15 @@ AC_CHECK_MEMBERS([struct icmpstat.icps_outhist],,,
 #include <netinet/icmp_var.h>
 #endif])
 
+dnl Check for struct ifreq.ifr_hwaddr
+AC_CHECK_MEMBERS([struct ifreq.ifr_hwaddr],,,
+[#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_NET_IF_H
+# include <net/if.h>
+#endif])
+
 dnl Check for the external timezone variables timezone and daylight
 AC_CACHE_CHECK([for timezone variable], ac_cv_have_timezone,
                AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[timezone = 1]])],[ac_cv_have_timezone="yes"],[ac_cv_have_timezone="no"]))
diff --git a/dlls/iphlpapi/ifenum.c b/dlls/iphlpapi/ifenum.c
index d348229..02c6a9d 100644
--- a/dlls/iphlpapi/ifenum.c
+++ b/dlls/iphlpapi/ifenum.c
@@ -298,7 +298,7 @@ static DWORD getInterfaceMaskByName(const char *name)
   return ret;
 }
 
-#if defined (SIOCGIFHWADDR)
+#if defined (SIOCGIFHWADDR) && defined (HAVE_STRUCT_IFREQ_IFR_HWADDR)
 static DWORD getInterfacePhysicalByName(const char *name, PDWORD len, PBYTE addr,
  PDWORD type)
 {
diff --git a/include/config.h.in b/include/config.h.in
index 7c34980..fb8a79b 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -777,6 +777,9 @@
 /* Define to 1 if `icps_outhist' is a member of `struct icmpstat'. */
 #undef HAVE_STRUCT_ICMPSTAT_ICPS_OUTHIST
 
+/* Define to 1 if `ifr_hwaddr' is a member of `struct ifreq'. */
+#undef HAVE_STRUCT_IFREQ_IFR_HWADDR
+
 /* Define to 1 if `msg_accrights' is a member of `struct msghdr'. */
 #undef HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS
 




More information about the wine-cvs mailing list