apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r153932 - in apr/apr/trunk: build/apr_network.m4 configure.in network_io/unix/multicast.c
Date Tue, 15 Feb 2005 12:01:07 GMT
Author: jorton
Date: Tue Feb 15 04:01:00 2005
New Revision: 153932

URL: http://svn.apache.org/viewcvs?view=rev&rev=153932
Log:
Fix HP-UX 11.00 build, where the IP multicast interfaces are not
declared if _XOPEN_SOURCE_EXTENDED is defined (which apr_hints.m4
does):

* build/apr_network.m4 (APR_CHECK_MCAST): New macro.

* configure.in: Use APR_CHECK_MCAST.

* network_io/unix/multicast.c: Make implementation conditional on
HAVE_STRUCT_IPMREQ.

Modified:
    apr/apr/trunk/build/apr_network.m4
    apr/apr/trunk/configure.in
    apr/apr/trunk/network_io/unix/multicast.c

Modified: apr/apr/trunk/build/apr_network.m4
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/build/apr_network.m4?view=diff&r1=153931&r2=153932
==============================================================================
--- apr/apr/trunk/build/apr_network.m4 (original)
+++ apr/apr/trunk/build/apr_network.m4 Tue Feb 15 04:01:00 2005
@@ -667,6 +667,22 @@
 fi
 ])
 
+dnl APR_CHECK_MCAST: check for multicast interfaces
+AC_DEFUN([APR_CHECK_MCAST], [
+AC_CACHE_CHECK([for struct ip_mreq], [apr_cv_struct_ipmreq], [
+AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <netinet/in.h>
+], [
+    struct ip_mreq mip;
+    mip.imr_interface.s_addr = INADDR_ANY;
+], [apr_cv_struct_ipmreq=yes], [apr_cv_struct_ipmreq=no], [apr_cv_struct_ipmreq=yes])])
+
+if test $apr_cv_struct_ipmreq = yes; then
+   AC_DEFINE([HAVE_STRUCT_IPMREQ], 1, [Define if struct impreq was found])
+fi
+])
+
 dnl
 dnl APR_CHECK_H_ERRNO_FLAG
 dnl

Modified: apr/apr/trunk/configure.in
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/configure.in?view=diff&r1=153931&r2=153932
==============================================================================
--- apr/apr/trunk/configure.in (original)
+++ apr/apr/trunk/configure.in Tue Feb 15 04:01:00 2005
@@ -1908,6 +1908,7 @@
 fi
 
 APR_CHECK_SCTP
+APR_CHECK_MCAST
 
 AC_SUBST(apr_tcp_nopush_flag)
 AC_SUBST(have_corkable_tcp)

Modified: apr/apr/trunk/network_io/unix/multicast.c
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/network_io/unix/multicast.c?view=diff&r1=153931&r2=153932
==============================================================================
--- apr/apr/trunk/network_io/unix/multicast.c (original)
+++ apr/apr/trunk/network_io/unix/multicast.c Tue Feb 15 04:01:00 2005
@@ -24,6 +24,7 @@
 #include <ifaddrs.h>
 #endif
 
+#ifdef HAVE_STRUCT_IPMREQ
 /* Only UDP and Raw Sockets can be used for Multicast */
 static apr_status_t mcast_check_type(apr_socket_t *sock)
 {
@@ -254,13 +255,14 @@
 
     return rv;
 }
+#endif
 
 APR_DECLARE(apr_status_t) apr_mcast_join(apr_socket_t *sock,
                                          apr_sockaddr_t *join,
                                          apr_sockaddr_t *iface,
                                          apr_sockaddr_t *source)
 {
-#ifdef IP_ADD_MEMBERSHIP
+#if defined(IP_ADD_MEMBERSHIP) && defined(HAVE_STRUCT_IPMREQ)
     return do_mcast(IP_ADD_MEMBERSHIP, sock, join, iface, source);
 #else
     return APR_ENOTIMPL;
@@ -272,7 +274,7 @@
                                           apr_sockaddr_t *iface,
                                           apr_sockaddr_t *source)
 {
-#ifdef IP_DROP_MEMBERSHIP
+#if defined(IP_DROP_MEMBERSHIP) && defined(HAVE_STRUCT_IPMREQ)
     return do_mcast(IP_DROP_MEMBERSHIP, sock, addr, iface, source);
 #else
     return APR_ENOTIMPL;
@@ -281,7 +283,7 @@
 
 APR_DECLARE(apr_status_t) apr_mcast_hops(apr_socket_t *sock, apr_byte_t ttl)
 {
-#ifdef IP_MULTICAST_TTL
+#if defined(IP_MULTICAST_TTL) && defined(HAVE_STRUCT_IPMREQ)
     return do_mcast_opt(IP_MULTICAST_TTL, sock, ttl);
 #else
     return APR_ENOTIMPL;
@@ -291,7 +293,7 @@
 APR_DECLARE(apr_status_t) apr_mcast_loopback(apr_socket_t *sock,
                                              apr_byte_t opt)
 {
-#ifdef IP_MULTICAST_LOOP
+#if defined(IP_MULTICAST_LOOP) && defined(HAVE_STRUCT_IPMREQ)
     return do_mcast_opt(IP_MULTICAST_LOOP, sock, opt);
 #else
     return APR_ENOTIMPL;
@@ -301,7 +303,7 @@
 APR_DECLARE(apr_status_t) apr_mcast_interface(apr_socket_t *sock,
                                               apr_sockaddr_t *iface)
 {
-#ifdef IP_MULTICAST_IF
+#if defined(IP_MULTICAST_IF) && defined(HAVE_STRUCT_IPMREQ)
     apr_status_t rv = APR_SUCCESS;
 
     if (sock_is_ipv4(sock)) {



Mime
View raw message