patch for socklen_t detection by Albert Chin-A-Young <china@thewrittenword.com>

Daniel
This commit is contained in:
Daniel Veillard 2000-10-11 23:39:43 +00:00
parent cd4296125d
commit b0426caeb9
7 changed files with 41 additions and 33 deletions

View File

@ -1,3 +1,9 @@
Thu Oct 12 01:37:53 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org>
* config.h.in configure.in nanoftp.c nanohttp.c xmlversion.h.in :
patch for socklen_t detection by
Albert Chin-A-Young <china@thewrittenword.com>
Wed Oct 11 17:53:57 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org>
* tree.c valid.c xmllint.c: Fixed a few postvalidation bugs

View File

@ -153,3 +153,5 @@
/* Define if compiler has function prototypes */
#undef PROTOTYPES
/* Type of socket length (socklen_t) */
#undef SOCKLEN_T

View File

@ -87,7 +87,8 @@ fi
AC_SUBST(HTML_DIR)
AC_ARG_ENABLE(corba, [ --enable-corba Add Corba support (default)])
AC_ARG_ENABLE(corba,
[ --enable-corba Add Corba support (default)])
dnl
dnl Corba is enabled by default
@ -108,6 +109,32 @@ AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
AC_CHECK_FUNC(connect, , AC_CHECK_LIB(inet, connect))
dnl Determine what socket length (socklen_t) data type is
AC_MSG_CHECKING([for type of socket length (socklen_t)])
AC_TRY_COMPILE2([
#include <stddef.h>
#include <sys/types.h>
#include <sys/socket.h>],[
(void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
AC_MSG_RESULT(socklen_t *)
SOCKLEN_T=socklen_t],[
AC_TRY_COMPILE2([
#include <stddef.h>
#include <sys/types.h>
#include <sys/socket.h>],[
(void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
AC_MSG_RESULT(size_t *)
SOCKLEN_T=size_t],[
AC_TRY_COMPILE2([
#include <stddef.h>
#include <sys/types.h>
#include <sys/socket.h>],[
(void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
AC_MSG_RESULT(int *)
SOCKLEN_T=int],[
AC_MSG_WARN(could not determine)])])])
AC_DEFINE_UNQUOTED(SOCKLEN_T, $SOCKLEN_T)
dnl Checks for isnan in libm if not in libc
AC_CHECK_FUNC(isnan, , AC_CHECK_LIB(m, isnan,
[M_LIBS="-lm"; AC_DEFINE(HAVE_ISNAN)]))
@ -135,13 +162,14 @@ if test "${GCC}" != "yes" ; then
;;
esac
fi
case $host in
*-*-solaris*)
case ${host} in
*-*-solaris*)
XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
;;
esac
dnl
dnl Use buffers for content
dnl

View File

@ -22,16 +22,6 @@ extern void xmlCheckVersion(int version);
#define LIBXML_VERSION_STRING "@LIBXML_VERSION_NUMBER@"
#define LIBXML_TEST_VERSION xmlCheckVersion(@LIBXML_VERSION_NUMBER@);
/*
* a few extra config stuff which may not be handled easily in configure
*/
#ifndef HAVE_SOCKLEN_T
#if defined(__osf__) || defined(__Linux__)
#define HAVE_SOCKLEN_T
#endif
#endif
/*
* Whether the FTP support is configured in
*/

View File

@ -1244,11 +1244,7 @@ xmlNanoFTPGetConnection(void *ctx) {
unsigned char ad[6], *adp, *portp;
unsigned int temp[6];
struct sockaddr_in dataAddr;
#ifdef HAVE_SOCKLEN_T
socklen_t dataAddrLen;
#else
unsigned int dataAddrLen;
#endif
SOCKLEN_T dataAddrLen;
ctxt->dataFd = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (ctxt->dataFd < 0) {

View File

@ -678,11 +678,7 @@ xmlNanoHTTPConnectAttempt(struct in_addr ia, int port)
}
if ( FD_ISSET(s, &wfd) ) {
#ifdef HAVE_SOCKLEN_T
socklen_t len;
#else
unsigned int len;
#endif
SOCKLEN_T len;
len = sizeof(status);
if (getsockopt(s, SOL_SOCKET, SO_ERROR, &status, &len) < 0 ) {
/* Solaris error code */

View File

@ -22,16 +22,6 @@ extern void xmlCheckVersion(int version);
#define LIBXML_VERSION_STRING "@LIBXML_VERSION_NUMBER@"
#define LIBXML_TEST_VERSION xmlCheckVersion(@LIBXML_VERSION_NUMBER@);
/*
* a few extra config stuff which may not be handled easily in configure
*/
#ifndef HAVE_SOCKLEN_T
#if defined(__osf__) || defined(__Linux__)
#define HAVE_SOCKLEN_T
#endif
#endif
/*
* Whether the FTP support is configured in
*/