Here's the patch which rips out the configure macros and the ifdefs
in sa_common.c.

-- Jon


Index: configure.in
===================================================================
RCS file: /home/cvspublic/apr/configure.in,v
retrieving revision 1.425
diff -u -u -r1.425 configure.in
--- configure.in        4 Apr 2002 21:35:43 -0000       1.425
+++ configure.in        24 Apr 2002 18:56:00 -0000
@@ -1519,8 +1519,6 @@
 
 APR_CHECK_SOCKADDR_SA_LEN
 
-APR_CHECK_GETHOSTBYNAME_NAS
-
 dnl Check the types only if we have gethostbyname_r
 if test "$ac_cv_func_gethostbyname_r" = "yes"; then
     APR_CHECK_GETHOSTBYNAME_R_STYLE
Index: build/apr_network.m4
===================================================================
RCS file: /home/cvspublic/apr/build/apr_network.m4,v
retrieving revision 1.15
diff -u -u -r1.15 apr_network.m4
--- build/apr_network.m4        24 Mar 2002 16:01:33 -0000      1.15
+++ build/apr_network.m4        24 Apr 2002 18:56:00 -0000
@@ -170,53 +170,6 @@
 fi
 ])
 
-
-dnl
-dnl check for gethostbyname() which handles numeric address strings
-dnl
-AC_DEFUN(APR_CHECK_GETHOSTBYNAME_NAS,[
-  AC_CACHE_CHECK(for gethostbyname() which handles numeric address strings, 
ac_cv_gethostbyname_nas,[
-  AC_TRY_RUN( [
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-void main(void) {
-    struct hostent *he = gethostbyname("127.0.0.1");
-    if (he == NULL) {
-        exit(1);
-    }
-    he = gethostbyname("255.255.255.255");
-    if (he == NULL) {
-        exit(1);
-    }
-    else {
-        exit(0);
-    }
-}
-],[
-  ac_cv_gethostbyname_nas="yes"
-],[
-  ac_cv_gethostbyname_nas="no"
-],[
-  ac_cv_gethostbyname_nas="yes"
-])])
-if test "$ac_cv_gethostbyname_nas" = "yes"; then
-  AC_DEFINE(GETHOSTBYNAME_HANDLES_NAS, 1, [Define if gethostbyname() handles 
nnn.nnn.nnn.nnn])
-fi
-])
-
 dnl
 dnl Checks the definition of gethostbyname_r and gethostbyaddr_r
 dnl which are different for glibc, solaris and assorted other operating
Index: network_io/unix/sa_common.c
===================================================================
RCS file: /home/cvspublic/apr/network_io/unix/sa_common.c,v
retrieving revision 1.54
diff -u -u -r1.54 sa_common.c
--- network_io/unix/sa_common.c 1 Apr 2002 14:13:45 -0000       1.54
+++ network_io/unix/sa_common.c 24 Apr 2002 18:56:01 -0000
@@ -417,7 +417,6 @@
             family = APR_INET; /* we don't support IPv6 here */
         }
 
-#ifndef GETHOSTBYNAME_HANDLES_NAS
         if (*hostname >= '0' && *hostname <= '9' &&
             strspn(hostname, "0123456789.") == strlen(hostname)) {
             struct in_addr ipaddr;
@@ -426,7 +425,6 @@
             save_addrinfo(p, *sa, ipaddr, port);
         }
         else {
-#endif
 #if APR_HAS_THREADS && !defined(GETHOSTBYNAME_IS_THREAD_SAFE) && \
     defined(HAVE_GETHOSTBYNAME_R) && !defined(BEOS)
 #if defined(GETHOSTBYNAME_R_HOSTENT_DATA)
@@ -474,9 +472,7 @@
                           port);
             ++curaddr;
         }
-#ifndef GETHOSTBYNAME_HANDLES_NAS
         }
-#endif
     }
     else {
         (*sa)->pool = p;

Reply via email to