Fix "socklen_t" detection under solaris (may break something on old solaris).

parent c5152faf
......@@ -2595,22 +2595,6 @@ rm -f conftest*
cat > conftest.$ac_ext <<EOF
#line 2597 "configure"
#include "confdefs.h"
#include <unistd.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
egrep "socklen_t" >/dev/null 2>&1; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define SOCKLEN_T_IN_UNISTD_H 1
EOF
fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
#line 2613 "configure"
#include "confdefs.h"
#include <netdb.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
......@@ -2629,17 +2613,17 @@ for ac_hdr in stddef.h getopt.h strings.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2633: checking for $ac_hdr" >&5
echo "configure:2617: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2638 "configure"
#line 2622 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2643: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2627: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -2669,17 +2653,17 @@ for ac_hdr in sys/sockio.h fcntl.h sys/time.h sys/times.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2673: checking for $ac_hdr" >&5
echo "configure:2657: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2678 "configure"
#line 2662 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2683: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2667: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -2709,17 +2693,17 @@ for ac_hdr in dlfcn.h regex.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2713: checking for $ac_hdr" >&5
echo "configure:2697: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2718 "configure"
#line 2702 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2723: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2707: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -2749,17 +2733,17 @@ for ac_hdr in arpa/inet.h net/if.h netinet/in.h sys/socket.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2753: checking for $ac_hdr" >&5
echo "configure:2737: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2758 "configure"
#line 2742 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2763: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2747: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -2789,17 +2773,17 @@ for ac_hdr in dvdread/dvd_reader.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:2793: checking for $ac_hdr" >&5
echo "configure:2777: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2798 "configure"
#line 2782 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2803: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:2787: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -2828,13 +2812,13 @@ done
echo $ac_n "checking whether setsockopt accepts SO_BINDTODEVICE""... $ac_c" 1>&6
echo "configure:2832: checking whether setsockopt accepts SO_BINDTODEVICE" >&5
echo "configure:2816: checking whether setsockopt accepts SO_BINDTODEVICE" >&5
if eval "test \"`echo '$''{'ac_cv_c_so_bindtodevice'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
CFLAGS="${save_CFLAGS} -Wall -Werror"
cat > conftest.$ac_ext <<EOF
#line 2838 "configure"
#line 2822 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
......@@ -2842,7 +2826,7 @@ int main() {
int optname(void) { return SO_BINDTODEVICE; }
; return 0; }
EOF
if { (eval echo configure:2846: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_so_bindtodevice=yes
else
......@@ -2863,20 +2847,20 @@ EOF
fi
echo $ac_n "checking if \$CC accepts -shared""... $ac_c" 1>&6
echo "configure:2867: checking if \$CC accepts -shared" >&5
echo "configure:2851: checking if \$CC accepts -shared" >&5
if eval "test \"`echo '$''{'ac_cv_ld_plugins'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
CFLAGS="${save_CFLAGS} -shared"
cat > conftest.$ac_ext <<EOF
#line 2873 "configure"
#line 2857 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
if { (eval echo configure:2880: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2864: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_ld_plugins=yes
else
......@@ -2894,20 +2878,20 @@ if test x"$ac_cv_ld_plugins" != x"no"; then
fi
echo $ac_n "checking if \$CC accepts -rdynamic""... $ac_c" 1>&6
echo "configure:2898: checking if \$CC accepts -rdynamic" >&5
echo "configure:2882: checking if \$CC accepts -rdynamic" >&5
if eval "test \"`echo '$''{'ac_cv_ld_rdynamic'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
CFLAGS="${save_CFLAGS} -rdynamic"
cat > conftest.$ac_ext <<EOF
#line 2904 "configure"
#line 2888 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
if { (eval echo configure:2911: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2895: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_ld_rdynamic=yes
else
......@@ -2929,12 +2913,12 @@ LDFLAGS="${save_LDFLAGS}"
echo $ac_n "checking for working const""... $ac_c" 1>&6
echo "configure:2933: checking for working const" >&5
echo "configure:2917: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2938 "configure"
#line 2922 "configure"
#include "confdefs.h"
int main() {
......@@ -2983,7 +2967,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
if { (eval echo configure:2987: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2971: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
......@@ -3004,12 +2988,12 @@ EOF
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
echo "configure:3008: checking for ANSI C header files" >&5
echo "configure:2992: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3013 "configure"
#line 2997 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
......@@ -3017,7 +3001,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3021: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:3005: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
......@@ -3034,7 +3018,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 3038 "configure"
#line 3022 "configure"
#include "confdefs.h"
#include <string.h>
EOF
......@@ -3052,7 +3036,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 3056 "configure"
#line 3040 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
......@@ -3073,7 +3057,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
#line 3077 "configure"
#line 3061 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
......@@ -3084,7 +3068,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
if { (eval echo configure:3088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:3072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
......@@ -3108,12 +3092,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
echo "configure:3112: checking for size_t" >&5
echo "configure:3096: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3117 "configure"
#line 3101 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
......@@ -3141,12 +3125,12 @@ EOF
fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
echo "configure:3145: checking whether time.h and sys/time.h may both be included" >&5
echo "configure:3129: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3150 "configure"
#line 3134 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
......@@ -3155,7 +3139,7 @@ int main() {
struct tm *tp;
; return 0; }
EOF
if { (eval echo configure:3159: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:3143: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
......
......@@ -151,9 +151,6 @@ AC_EGREP_HEADER(struct iovec,sys/uio.h,[
AC_EGREP_HEADER(strncasecmp,strings.h,[
AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
Define if <strings.h> defines strncasecmp.)])
AC_EGREP_HEADER(socklen_t,unistd.h,[
AC_DEFINE(SOCKLEN_T_IN_UNISTD_H, 1,
Define if <unistd.h> defines socklen_t.)])
AC_EGREP_HEADER(getprotobyname,netdb.h,[
AC_DEFINE(GETPROTOBYNAME_IN_NETDB_H, 1,
Define if <netdb.h> defines getprotobyname.)])
......
......@@ -112,9 +112,6 @@
/* Define if <strings.h> defines strncasecmp. */
#undef STRNCASECMP_IN_STRINGS_H
/* Define if <unistd.h> defines socklen_t. */
#undef SOCKLEN_T_IN_UNISTD_H
/* Define if <netdb.h> defines getprotobyname. */
#undef GETPROTOBYNAME_IN_NETDB_H
......
......@@ -2,7 +2,7 @@
* socket.cpp: socket management
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: socket.cpp,v 1.1 2001/10/06 21:23:36 bozo Exp $
* $Id: socket.cpp,v 1.2 2001/10/16 12:24:39 bozo Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -72,20 +72,15 @@
//------------------------------------------------------------------------------
// Plateform specific issues
//------------------------------------------------------------------------------
#ifdef SOCKLEN_T_IN_UNISTD_H
#define ERR_INTR EINTR
#define bufftype byte
#define socklen socklen_t
#elif defined WIN32
#if defined WIN32
#define ERR_INTR WSAEINTR
#define bufftype char
#define socklen int
#else /* default values, for instance under Solaris */
#else
#define ERR_INTR EINTR
#define bufftype char
#define socklen int
#define bufftype byte
#define socklen socklen_t
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment