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
CFLAGS_OLD="$CFLAGS"
if test "$GCC" = yes ; then
CFLAGS="-Werror $CFLAGS"
fi
ac_ext=cc
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
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
/* confdefs.h. */
@@ -44709,7 +44710,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(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 $ac_try) 2>&5
ac_status=$?
@@ -44756,7 +44757,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(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 $ac_try) 2>&5
ac_status=$?
@@ -44780,8 +44781,12 @@ rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
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

View File

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