From 7cd8ab4425c2f0b1349be5760cd4e39f92b9d2af Mon Sep 17 00:00:00 2001 From: Daniel Caujolle-Bert Date: Fri, 23 Jul 2004 12:42:14 +0000 Subject: made io_helper.c compile under Solaris 2.6 (socklen_t undefine type) (close #992824) CVS patchset: 6840 CVS date: 2004/07/23 12:42:14 --- configure.ac | 6 ++++++ m4/_xine.m4 | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/configure.ac b/configure.ac index d01ecaa16..9b0c75893 100644 --- a/configure.ac +++ b/configure.ac @@ -352,6 +352,12 @@ AC_CHECK_LIB(nsl, gethostbyname, NET_LIBS="-lnsl $NET_LIBS",) AC_SUBST(NET_LIBS) +dnl --------------------------------------------- +dnl socklen_t +dnl --------------------------------------------- +AC_CHECK_SOCKLEN_T + + dnl --------------------------------------------- dnl IPv6 dnl --------------------------------------------- diff --git a/m4/_xine.m4 b/m4/_xine.m4 index 2051eaf4a..d8e675a16 100644 --- a/m4/_xine.m4 +++ b/m4/_xine.m4 @@ -371,3 +371,38 @@ _ACEOF fi ;; esac ])# AC_PROG_LIBTOOL_SANITYCHECK + +dnl Check for the type of the third argument of getsockname +AC_DEFUN([AC_CHECK_SOCKLEN_T], [ + AC_MSG_CHECKING(for socklen_t) + AC_CACHE_VAL(ac_cv_socklen_t, [ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([ +#include +#include + ],[ +socklen_t a=0; +getsockname(0,(struct sockaddr*)0, &a); + ], + ac_cv_socklen_t=socklen_t, + AC_TRY_COMPILE([ +#include +#include + ],[ +int a=0; +getsockname(0,(struct sockaddr*)0, &a); + ], + ac_cv_socklen_t=int, + ac_cv_socklen_t=size_t + ) + ) + AC_LANG_RESTORE + ]) + + AC_MSG_RESULT($ac_cv_socklen_t) + if test "$ac_cv_socklen_t" != "socklen_t"; then + AC_DEFINE_UNQUOTED(socklen_t, $ac_cv_socklen_t, + [Define the real type of socklen_t]) + fi +]) -- cgit v1.2.3