Need to check for getsockopt argument in C++ mode.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43312 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Neis
2006-11-11 17:19:59 +00:00
parent c6f9d35581
commit e43101ee40
2 changed files with 19 additions and 20 deletions

19
configure vendored
View File

@@ -44674,10 +44674,11 @@ else
sed 's/^/| /' conftest.$ac_ext >&5 sed 's/^/| /' conftest.$ac_ext >&5
CFLAGS_OLD="$CFLAGS" ac_ext=cc
if test "$GCC" = yes ; then ac_cpp='$CXXCPP $CPPFLAGS'
CFLAGS="-Werror $CFLAGS" ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
fi ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat >conftest.$ac_ext <<_ACEOF cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */ /* confdefs.h. */
@@ -44709,7 +44710,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5 cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && (exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5 (eval $ac_try) 2>&5
ac_status=$? ac_status=$?
@@ -44756,7 +44757,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5 cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && (exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5 (eval $ac_try) 2>&5
ac_status=$? ac_status=$?
@@ -44780,8 +44781,12 @@ rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
CFLAGS="$CFLAGS_OLD"
fi fi

View File

@@ -6256,17 +6256,12 @@ if test "$wxUSE_SOCKETS" = "yes" ; then
], ],
wx_cv_type_getsockopt5=socklen_t, wx_cv_type_getsockopt5=socklen_t,
[ [
dnl the compiler will compile the version with size_t dnl Note that the rules for compatibility of pointers
dnl even if the real type of the last parameter is int dnl are somewhat different between C and C++, so code
dnl but it should give at least a warning about dnl that fails in C++ may not even give a warning about
dnl converting between incompatible pointer types, so dnl converting between incompatible pointer types in C.
dnl try to use it to get the correct behaviour at dnl So this test needs to be done in C++ mode.
dnl least with gcc (otherwise we'd always use size_t) AC_LANG_PUSH(C++)
CFLAGS_OLD="$CFLAGS"
if test "$GCC" = yes ; then
CFLAGS="-Werror $CFLAGS"
fi
AC_TRY_COMPILE( AC_TRY_COMPILE(
[ [
#include <sys/types.h> #include <sys/types.h>
@@ -6290,8 +6285,7 @@ if test "$wxUSE_SOCKETS" = "yes" ; then
wx_cv_type_getsockopt5=unknown wx_cv_type_getsockopt5=unknown
) )
) )
AC_LANG_POP()
CFLAGS="$CFLAGS_OLD"
] ]
) )
]) ])