Commit 9137e717 authored by Yang Tse's avatar Yang Tse
Browse files

Use build-time configured curl_socklen_t instead of socklen_t

parent 80186aa7
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -6,6 +6,9 @@

                                  Changelog

Yang Tse (2 May 2009)
- Use a build-time configured curl_socklen_t data type instead of socklen_t.

Yang Tse (1 May 2009)
- Applied David McCreedy's patches "TPF-platform specific changes to various
  files" and "http.c fix to Curl_proxyCONNECT for non-ASCII platforms", the
+0 −4
Original line number Diff line number Diff line
@@ -688,10 +688,6 @@ ENDIF(HAVE_INET_NTOA_R_DECL_REENTRANT)

# Some other minor tests

IF(NOT HAVE_SOCKLEN_T)
  SET(socklen_t "int")
ENDIF(NOT HAVE_SOCKLEN_T)

IF(NOT HAVE_IN_ADDR_T)
  SET(in_addr_t "unsigned long")
ENDIF(NOT HAVE_IN_ADDR_T)
+2 −1
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@ This release includes the following changes:
   the build-time fixed number
 o CURLOPT_SEEKFUNCTION may now return CURL_SEEKFUNC_CANTSEEK
 o curl can now upload with resume even when reading from a pipe
 o a build-time configured curl_socklen_t is now used instead of socklen_t

This release includes the following bugfixes:

@@ -49,6 +50,6 @@ advice from friends like these:
 Andre Guibert de Bruet, Andreas Farber, Frank Hempel, Pierre Brico,
 Kamil Dudka, Jim Freeman, Daniel Johnson, Toshio Kuratomi, Martin Storsjo,
 Pramod Sharma, Gisle Vanem, Leanic Lefever, Rainer Koenig, Sven Wegener,
 Tim Chen, Constantine Sapuntzakis David McCreedy
 Tim Chen, Constantine Sapuntzakis, David McCreedy

        Thanks! (and sorry if I forgot to mention someone)
+0 −89
Original line number Diff line number Diff line
@@ -983,94 +983,6 @@ AC_DEFUN([CURL_CHECK_HEADER_MEMORY], [
])


dnl CURL_CHECK_TYPE_SOCKLEN_T
dnl -------------------------------------------------
dnl Check for existing socklen_t type, and provide
dnl an equivalent type if socklen_t not available

AC_DEFUN([CURL_CHECK_TYPE_SOCKLEN_T], [
  AC_REQUIRE([CURL_CHECK_HEADER_WS2TCPIP])dnl
  AC_CHECK_TYPE([socklen_t], ,[
    dnl socklen_t not available
    AC_CACHE_CHECK([for socklen_t equivalent],
      [curl_cv_socklen_t_equiv], [
      curl_cv_socklen_t_equiv="unknown"
      for arg1 in 'int' 'SOCKET'; do
        for arg2 in "struct sockaddr" void; do
          for t in int size_t unsigned long "unsigned long"; do
            if test "$curl_cv_socklen_t_equiv" = "unknown"; then
              AC_COMPILE_IFELSE([
                AC_LANG_PROGRAM([[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#else
#ifdef HAVE_WINSOCK_H
#include <winsock.h>
#endif
#endif
#define GETPEERNCALLCONV PASCAL
#else
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#define GETPEERNCALLCONV
#endif
                  extern int GETPEERNCALLCONV getpeername($arg1, $arg2 *, $t *);
                ]],[[
                  $t len=0;
                  getpeername(0,0,&len);
                ]])
              ],[
                curl_cv_socklen_t_equiv="$t"
              ])
            fi
          done
        done
      done
    ])
    case "$curl_cv_socklen_t_equiv" in
      unknown)
        AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
        ;;
      *)
        AC_DEFINE_UNQUOTED(socklen_t, $curl_cv_socklen_t_equiv,
          [Type to use in place of socklen_t when system does not provide it.])
        ;;
    esac
  ],[
#undef inline
#ifdef HAVE_WINDOWS_H
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#ifdef HAVE_WS2TCPIP_H
#include <ws2tcpip.h>
#endif
#endif
#else
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#endif
  ])
])


dnl CURL_CHECK_FUNC_GETNAMEINFO
dnl -------------------------------------------------
dnl Test if the getnameinfo function is available, 
@@ -1084,7 +996,6 @@ dnl argument in GETNAMEINFO_QUAL_ARG1.

AC_DEFUN([CURL_CHECK_FUNC_GETNAMEINFO], [
  AC_REQUIRE([CURL_CHECK_HEADER_WS2TCPIP])dnl
  AC_REQUIRE([CURL_CHECK_TYPE_SOCKLEN_T])dnl
  AC_CHECK_HEADERS(sys/types.h sys/socket.h netdb.h)
  #
  AC_MSG_CHECKING([for getnameinfo])
+0 −3
Original line number Diff line number Diff line
@@ -2021,9 +2021,6 @@ AC_CHECK_TYPE([bool],[

CURL_CONFIGURE_CURL_SOCKLEN_T

# Check for socklen_t or equivalent
CURL_CHECK_TYPE_SOCKLEN_T

TYPE_IN_ADDR_T

TYPE_SOCKADDR_STORAGE
Loading