Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 47080 invoked from network); 15 Apr 2006 01:34:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 15 Apr 2006 01:34:20 -0000 Received: (qmail 90843 invoked by uid 500); 15 Apr 2006 01:34:14 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 90531 invoked by uid 500); 15 Apr 2006 01:34:13 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 90090 invoked by uid 99); 15 Apr 2006 01:34:12 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Apr 2006 18:34:11 -0700 X-ASF-Spam-Status: No, hits=3.1 required=10.0 tests=INVALID_MSGID,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: 128.184.134.6 is neither permitted nor denied by domain of jayvdb@gmail.com) Received: from [128.184.134.6] (HELO hygeia.its.deakin.edu.au) (128.184.134.6) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Apr 2006 18:34:11 -0700 Received: from hygeia.its.deakin.edu.au (localhost.localdomain [127.0.0.1]) by hygeia.its.deakin.edu.au (Postfix) with ESMTP id 7648F73938; Sat, 15 Apr 2006 11:44:51 +1000 (EST) Received: (from johnv@localhost) by hygeia.its.deakin.edu.au (8.13.1/8.13.1/Submit) id k3F1ipmT009960; Sat, 15 Apr 2006 11:44:51 +1000 X-Authentication-Warning: hygeia.its.deakin.edu.au: johnv set sender to John Mark Vandenberg using -f Message-Id: <20060415014451.334277000@gmail.com>> References: <20060415014118.424412000@gmail.com>> User-Agent: quilt/0.44-1 Date: Sat, 15 Apr 2006 11:41:29 +1000 From: John Mark Vandenberg To: dev@apr.apache.org Cc: davi@haxent.com.br Subject: [patch 11/17] struct in_addr Content-Disposition: inline; filename=win32api-in_addr.patch X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Move the autoconf check for type 'in_addr' into a macro, and improve it to work for Windows as well. Index: build/apr_network.m4 =================================================================== --- build/apr_network.m4.orig +++ build/apr_network.m4 @@ -17,6 +17,31 @@ dnl ------------------------------------ dnl apr_network.m4: APR's autoconf macros for testing network support dnl +dnl check for type in_addr +dnl +dnl +AC_DEFUN(APR_TYPE_IN_ADDR,[ + AC_CACHE_CHECK(for type in_addr, ac_cv_type_in_addr,[ + AC_TRY_COMPILE([ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_WINSOCK2_H +#include +#endif +],[ + struct in_addr arg; + arg.s_addr = htonl(INADDR_ANY); +], [ ac_cv_type_in_addr="yes"] , [ +ac_cv_type_in_addr="no"]) +]) +]) + +dnl + dnl dnl check for working getaddrinfo() dnl Index: configure.in =================================================================== --- configure.in.orig +++ configure.in @@ -1971,17 +1971,12 @@ AC_CHECK_MEMBERS([struct tm.tm_gmtoff, s dnl ----------------------------- Checking for Networking Support echo "${nl}Checking for Networking support..." -AC_MSG_CHECKING(for in_addr in netinet/in.h) -AC_TRY_COMPILE([ -#include -#include -],[ -struct in_addr arg; -arg.s_addr = htonl(INADDR_ANY); -], [ have_in_addr="1" -msg=yes ] , [ have_in_addr="0" -msg=no ]) -AC_MSG_RESULT([$msg]) +APR_TYPE_IN_ADDR +if test "$ac_cv_type_in_addr" = "yes"; then + have_in_addr="1" +else + have_in_addr="0" +fi AC_MSG_CHECKING([if fd == socket on this platform]) if test "x$file_as_socket" != "x0" ; then --