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

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()
]
)
])