You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by John Mark Vandenberg <ja...@gmail.com> on 2006/04/15 03:41:29 UTC

[patch 11/17] struct in_addr

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 <sys/types.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#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 <sys/types.h>
-#include <netinet/in.h>
-],[
-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

--

Re: [patch 11/17] struct in_addr

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
On 4/14/06, John Mark Vandenberg <ja...@gmail.com> wrote:
> Move the autoconf check for type 'in_addr' into a macro, and
> improve it to work for Windows as well.

Committed in r421071.  Thanks!  -- justin