From: Harlan Stenn Date: Thu, 12 Oct 2006 23:22:09 +0000 (-0400) Subject: Improve the getsockname() arg determination X-Git-Tag: NTP_4_2_3P57~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b7803ea1464cacac850b31cd162efa1268b0eb7;p=thirdparty%2Fntp.git Improve the getsockname() arg determination bk: 452ece21JWCi55vL1PT1TJZYIdC_-g --- diff --git a/configure.ac b/configure.ac index 3f1f82498..10e960216 100644 --- a/configure.ac +++ b/configure.ac @@ -1010,18 +1010,22 @@ no) esac AC_MSG_CHECKING([type of socklen arg for getsockname()]) -AC_CACHE_VAL(ac_cv_func_getsockname_socklen_type,dnl -[for ac_cv_func_getsockname_socklen_type in 'socklen_t' 'size_t' 'unsigned int' 'int'; do - AC_TRY_COMPILE(dnl +AC_CACHE_VAL(ac_cv_func_getsockname_arg2,dnl +[AC_CACHE_VAL(ac_cv_func_getsockname_socklen_type,dnl + [for ac_cv_func_getsockname_arg2 in 'struct sockaddr *' 'void *'; do + for ac_cv_func_getsockname_socklen_type in 'socklen_t' 'size_t' 'unsigned int' 'int'; do + AC_TRY_COMPILE(dnl [#ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif -extern getsockname (int, struct sockaddr *, $ac_cv_func_getsockname_socklen_type *);],,dnl - [ac_not_found=no ; break], ac_not_found=yes) - done +extern getsockname (int, $ac_cv_func_getsockname_arg2, $ac_cv_func_getsockname_socklen_type *);],,dnl + [ac_not_found=no ; break 2], ac_not_found=yes) + done + done + ])dnl AC_CACHE_VAL ])dnl AC_CACHE_VAL if test "$ac_not_found" = yes; then ac_cv_func_getsockname_socklen_type='socklen_t'