| 1 |
dnl This function is (C) 1997,98,99 Stephan Kulow ([email protected]) |
| 2 |
dnl Modifications (C) Joe Orton 1999,2000 |
| 3 |
|
| 4 |
AC_DEFUN([SOCKLEN_ARG_TYPE],[ |
| 5 |
|
| 6 |
dnl Check for the type of the third argument of getsockname |
| 7 |
AC_MSG_CHECKING(for the third argument of getsockname) |
| 8 |
AC_CACHE_VAL(ac_cv_ksize_t, |
| 9 |
[AC_TRY_COMPILE([ |
| 10 |
#include <sys/types.h> |
| 11 |
#include <sys/socket.h> |
| 12 |
],[ |
| 13 |
socklen_t a=0; |
| 14 |
getsockname(0,(struct sockaddr*)0, &a); |
| 15 |
], |
| 16 |
ac_cv_ksize_t=socklen_t, |
| 17 |
ac_cv_ksize_t=) |
| 18 |
if test -z "$ac_cv_ksize_t"; then |
| 19 |
ac_safe_cflags="$CFLAGS" |
| 20 |
if test "$GCC" = "yes"; then |
| 21 |
CFLAGS="-Werror $CFLAGS" |
| 22 |
fi |
| 23 |
AC_TRY_COMPILE([ |
| 24 |
#include <sys/types.h> |
| 25 |
#include <sys/socket.h> |
| 26 |
],[ |
| 27 |
int a=0; |
| 28 |
getsockname(0,(struct sockaddr*)0, &a); |
| 29 |
], |
| 30 |
ac_cv_ksize_t=int, |
| 31 |
ac_cv_ksize_t=size_t) |
| 32 |
CFLAGS="$ac_safe_cflags" |
| 33 |
fi |
| 34 |
]) |
| 35 |
|
| 36 |
if test -z "$ac_cv_ksize_t"; then |
| 37 |
ac_cv_ksize_t=int |
| 38 |
fi |
| 39 |
|
| 40 |
AC_MSG_RESULT($ac_cv_ksize_t) |
| 41 |
AC_DEFINE_UNQUOTED(ksize_t, $ac_cv_ksize_t, [Define to be the type of the third argument to getsockname]) |
| 42 |
|
| 43 |
]) |