From 37a6a67b83419b7d616642ed988f55f474e8f68e Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Wed, 17 Apr 2002 01:16:20 +0000 Subject: Add checks for gethostbyaddr_r 2002-04-16 Jeffrey Stedfast * configure.in: Add checks for gethostbyaddr_r svn path=/trunk/; revision=16482 --- ChangeLog | 4 ++++ acconfig.h | 3 +++ configure.in | 37 +++++++++++++++++++++++++++++++++++-- 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index fd0a3beff0..e9a483cc4b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2002-04-16 Jeffrey Stedfast + + * configure.in: Add checks for gethostbyaddr_r + 2002-04-14 Jeffrey Stedfast * configure.in: Check for socklen_t and if it doesn't exist, diff --git a/acconfig.h b/acconfig.h index 5e1b0b0a41..e4aed8a2d6 100644 --- a/acconfig.h +++ b/acconfig.h @@ -43,5 +43,8 @@ /* Define if gethostbyname_r takes five arguments */ #undef GETHOSTBYNAME_R_FIVE_ARGS +/* Define if gethostbyaddr_r takes seven arguments */ +#undef GETHOSTBYADDR_R_SEVEN_ARGS + /* Define to `int' if your system doesn't have `socklen_t'. */ #undef socklen_t diff --git a/configure.in b/configure.in index 8514145180..7608f0d3ca 100644 --- a/configure.in +++ b/configure.in @@ -265,7 +265,7 @@ AC_CACHE_CHECK([if gethostbyname_r wants five arguments], ac_cv_gethostbyname_r_ int bufsize=BUFSIZE; int h_errno; - (void)gethostbyname_r( "www.ximian.com", &hent, buffer, bufsize, &h_errno); + (void)gethostbyname_r ("www.ximian.com", &hent, buffer, bufsize, &h_errno); ],[ ac_cv_gethostbyname_r_five_args=yes ],[ @@ -273,10 +273,43 @@ AC_CACHE_CHECK([if gethostbyname_r wants five arguments], ac_cv_gethostbyname_r_ ]) ])]) -if test x"$ac_cv_gethostbyname_r_five_args" = xyes ; then +if test "x$ac_cv_gethostbyname_r_five_args" = "xyes" ; then AC_DEFINE(GETHOSTBYNAME_R_FIVE_ARGS) fi +dnl ************************************************** +dnl gethostbyaddr_r prototype +dnl ************************************************** + +AC_CHECK_FUNCS(gethostbyaddr_r,[ +AC_CACHE_CHECK([if gethostbyaddr_r wants seven arguments], ac_cv_gethostbyaddr_r_seven_args, +[ + AC_TRY_COMPILE([ + #include "confdefs.h" + #include + #include + #include + #include + + #define BUFSIZE (sizeof(struct hostent)+10) + ],[ + struct hostent hent; + char buffer[BUFSIZE]; + int bufsize=BUFSIZE; + int h_errno; + + (void)gethostbyaddr_r ("www.ximian.com", 14, AF_INET, &hent, buffer, bufsize, &h_errno); + ],[ + ac_cv_gethostbyaddr_r_seven_args=yes + ],[ + ac_cv_gethostbyaddr_r_seven_args=no + ]) +])]) + +if test "x$ac_cv_gethostbyaddr_r_seven_args" = "xyes" ; then + AC_DEFINE(GETHOSTBYADDR_R_SEVEN_ARGS) +fi + dnl *********** dnl * db3 stuff dnl *********** -- cgit v1.2.3