Replaced SOCKLEN_T by WX_SOCKLEN_T to resolve conflict with AIX system headers.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35387 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
2
configure
vendored
2
configure
vendored
@@ -39073,7 +39073,7 @@ echo "${ECHO_T}$wx_cv_type_getsockname3" >&6
|
|||||||
echo "$as_me: WARNING: Couldn't find socklen_t synonym for this system" >&2;}
|
echo "$as_me: WARNING: Couldn't find socklen_t synonym for this system" >&2;}
|
||||||
else
|
else
|
||||||
cat >>confdefs.h <<_ACEOF
|
cat >>confdefs.h <<_ACEOF
|
||||||
#define SOCKLEN_T $wx_cv_type_getsockname3
|
#define WX_SOCKLEN_T $wx_cv_type_getsockname3
|
||||||
_ACEOF
|
_ACEOF
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
@@ -5541,7 +5541,7 @@ if test "$wxUSE_SOCKETS" = "yes" ; then
|
|||||||
wxUSE_SOCKETS=no
|
wxUSE_SOCKETS=no
|
||||||
AC_MSG_WARN([Couldn't find socklen_t synonym for this system])
|
AC_MSG_WARN([Couldn't find socklen_t synonym for this system])
|
||||||
else
|
else
|
||||||
AC_DEFINE_UNQUOTED(SOCKLEN_T, $wx_cv_type_getsockname3)
|
AC_DEFINE_UNQUOTED(WX_SOCKLEN_T, $wx_cv_type_getsockname3)
|
||||||
fi
|
fi
|
||||||
dnl Do this again for getsockopt as it may be different
|
dnl Do this again for getsockopt as it may be different
|
||||||
AC_CACHE_CHECK([what is the type of the fifth argument of getsockopt],
|
AC_CACHE_CHECK([what is the type of the fifth argument of getsockopt],
|
||||||
|
@@ -691,7 +691,7 @@
|
|||||||
#undef WX_TIMEZONE
|
#undef WX_TIMEZONE
|
||||||
|
|
||||||
/* The type of 3rd argument to getsockname() - usually size_t or int */
|
/* The type of 3rd argument to getsockname() - usually size_t or int */
|
||||||
#undef SOCKLEN_T
|
#undef WX_SOCKLEN_T
|
||||||
|
|
||||||
/* The type of 5th argument to getsockopt() - usually size_t or int */
|
/* The type of 5th argument to getsockopt() - usually size_t or int */
|
||||||
#undef SOCKOPTLEN_T
|
#undef SOCKOPTLEN_T
|
||||||
@@ -751,6 +751,9 @@
|
|||||||
/* Define if you have pthread_cancel */
|
/* Define if you have pthread_cancel */
|
||||||
#undef HAVE_PTHREAD_CANCEL
|
#undef HAVE_PTHREAD_CANCEL
|
||||||
|
|
||||||
|
/* Define if you have pthread_attr_setstacksize */
|
||||||
|
#undef HAVE_PTHREAD_ATTR_SETSTACKSIZE
|
||||||
|
|
||||||
/* Define if you have sigaction() */
|
/* Define if you have sigaction() */
|
||||||
#undef HAVE_SIGACTION
|
#undef HAVE_SIGACTION
|
||||||
|
|
||||||
|
@@ -729,7 +729,7 @@
|
|||||||
#undef WX_TIMEZONE
|
#undef WX_TIMEZONE
|
||||||
|
|
||||||
/* The type of 3rd argument to getsockname() - usually size_t or int */
|
/* The type of 3rd argument to getsockname() - usually size_t or int */
|
||||||
#define SOCKLEN_T size_t
|
#define WX_SOCKLEN_T size_t
|
||||||
|
|
||||||
/* The type of 5th argument to getsockopt() - usually size_t or int */
|
/* The type of 5th argument to getsockopt() - usually size_t or int */
|
||||||
#define SOCKOPTLEN_T size_t
|
#define SOCKOPTLEN_T size_t
|
||||||
|
@@ -513,7 +513,7 @@ GSocketError GSocket::SetServer()
|
|||||||
if ((bind(m_endpoint, m_local->m_addr, m_local->m_len) != 0) ||
|
if ((bind(m_endpoint, m_local->m_addr, m_local->m_len) != 0) ||
|
||||||
(getsockname(m_endpoint,
|
(getsockname(m_endpoint,
|
||||||
m_local->m_addr,
|
m_local->m_addr,
|
||||||
(SOCKLEN_T *) &m_local->m_len) != 0) ||
|
(WX_SOCKLEN_T *) &m_local->m_len) != 0) ||
|
||||||
(listen(m_endpoint, 5) != 0))
|
(listen(m_endpoint, 5) != 0))
|
||||||
{
|
{
|
||||||
close(m_endpoint);
|
close(m_endpoint);
|
||||||
@@ -572,7 +572,7 @@ GSocket *GSocket::WaitConnection()
|
|||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
#if 0
|
#if 0
|
||||||
connection->m_endpoint = accept(m_endpoint, &from, (SOCKLEN_T *) &fromlen);
|
connection->m_endpoint = accept(m_endpoint, &from, (WX_SOCKLEN_T *) &fromlen);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (connection->m_endpoint == kOTInvalidEndpointRef )
|
if (connection->m_endpoint == kOTInvalidEndpointRef )
|
||||||
@@ -678,7 +678,7 @@ GSocketError GSocket::SetNonOriented()
|
|||||||
if ((bind(m_endpoint, m_local->m_addr, m_local->m_len) != 0) ||
|
if ((bind(m_endpoint, m_local->m_addr, m_local->m_len) != 0) ||
|
||||||
(getsockname(m_endpoint,
|
(getsockname(m_endpoint,
|
||||||
m_local->m_addr,
|
m_local->m_addr,
|
||||||
(SOCKLEN_T *) &m_local->m_len) != 0))
|
(WX_SOCKLEN_T *) &m_local->m_len) != 0))
|
||||||
{
|
{
|
||||||
close(m_endpoint);
|
close(m_endpoint);
|
||||||
m_endpoint = -1;
|
m_endpoint = -1;
|
||||||
@@ -795,7 +795,7 @@ GSocketError GSocket::Connect(GSocketStream stream)
|
|||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
int error;
|
int error;
|
||||||
SOCKLEN_T len = sizeof(error);
|
WX_SOCKLEN_T len = sizeof(error);
|
||||||
|
|
||||||
getsockopt(m_endpoint, SOL_SOCKET, SO_ERROR, (void*) &error, &len);
|
getsockopt(m_endpoint, SOL_SOCKET, SO_ERROR, (void*) &error, &len);
|
||||||
|
|
||||||
@@ -1093,12 +1093,12 @@ int GSocket::Recv_Dgram(char *buffer, int size)
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
#if 0
|
#if 0
|
||||||
struct sockaddr from;
|
struct sockaddr from;
|
||||||
SOCKLEN_T fromlen = sizeof(from);
|
WX_SOCKLEN_T fromlen = sizeof(from);
|
||||||
GSocketError err;
|
GSocketError err;
|
||||||
|
|
||||||
fromlen = sizeof(from);
|
fromlen = sizeof(from);
|
||||||
|
|
||||||
ret = recvfrom(m_endpoint, buffer, size, 0, &from, (SOCKLEN_T *) &fromlen);
|
ret = recvfrom(m_endpoint, buffer, size, 0, &from, (WX_SOCKLEN_T *) &fromlen);
|
||||||
|
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
@@ -524,7 +524,7 @@ GSocketError GSocket_SetServer(GSocket *sck)
|
|||||||
if ((bind(sck->m_endpoint, sck->m_local->m_addr, sck->m_local->m_len) != 0) ||
|
if ((bind(sck->m_endpoint, sck->m_local->m_addr, sck->m_local->m_len) != 0) ||
|
||||||
(getsockname(sck->m_endpoint,
|
(getsockname(sck->m_endpoint,
|
||||||
sck->m_local->m_addr,
|
sck->m_local->m_addr,
|
||||||
(SOCKLEN_T *) &sck->m_local->m_len) != 0) ||
|
(WX_SOCKLEN_T *) &sck->m_local->m_len) != 0) ||
|
||||||
(listen(sck->m_endpoint, 5) != 0))
|
(listen(sck->m_endpoint, 5) != 0))
|
||||||
{
|
{
|
||||||
close(sck->m_endpoint);
|
close(sck->m_endpoint);
|
||||||
@@ -583,7 +583,7 @@ GSocket *GSocket_WaitConnection(GSocket *socket)
|
|||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
#if 0
|
#if 0
|
||||||
connection->m_endpoint = accept(socket->m_endpoint, &from, (SOCKLEN_T *) &fromlen);
|
connection->m_endpoint = accept(socket->m_endpoint, &from, (WX_SOCKLEN_T *) &fromlen);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (connection->m_endpoint == kOTInvalidEndpointRef )
|
if (connection->m_endpoint == kOTInvalidEndpointRef )
|
||||||
@@ -689,7 +689,7 @@ GSocketError GSocket_SetNonOriented(GSocket *sck)
|
|||||||
if ((bind(sck->m_endpoint, sck->m_local->m_addr, sck->m_local->m_len) != 0) ||
|
if ((bind(sck->m_endpoint, sck->m_local->m_addr, sck->m_local->m_len) != 0) ||
|
||||||
(getsockname(sck->m_endpoint,
|
(getsockname(sck->m_endpoint,
|
||||||
sck->m_local->m_addr,
|
sck->m_local->m_addr,
|
||||||
(SOCKLEN_T *) &sck->m_local->m_len) != 0))
|
(WX_SOCKLEN_T *) &sck->m_local->m_len) != 0))
|
||||||
{
|
{
|
||||||
close(sck->m_endpoint);
|
close(sck->m_endpoint);
|
||||||
sck->m_endpoint = -1;
|
sck->m_endpoint = -1;
|
||||||
@@ -806,7 +806,7 @@ GSocketError GSocket_Connect(GSocket *sck, GSocketStream stream)
|
|||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
int error;
|
int error;
|
||||||
SOCKLEN_T len = sizeof(error);
|
WX_SOCKLEN_T len = sizeof(error);
|
||||||
|
|
||||||
getsockopt(sck->m_endpoint, SOL_SOCKET, SO_ERROR, (void*) &error, &len);
|
getsockopt(sck->m_endpoint, SOL_SOCKET, SO_ERROR, (void*) &error, &len);
|
||||||
|
|
||||||
@@ -1104,12 +1104,12 @@ int _GSocket_Recv_Dgram(GSocket *socket, char *buffer, int size)
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
#if 0
|
#if 0
|
||||||
struct sockaddr from;
|
struct sockaddr from;
|
||||||
SOCKLEN_T fromlen = sizeof(from);
|
WX_SOCKLEN_T fromlen = sizeof(from);
|
||||||
GSocketError err;
|
GSocketError err;
|
||||||
|
|
||||||
fromlen = sizeof(from);
|
fromlen = sizeof(from);
|
||||||
|
|
||||||
ret = recvfrom(socket->m_endpoint, buffer, size, 0, &from, (SOCKLEN_T *) &fromlen);
|
ret = recvfrom(socket->m_endpoint, buffer, size, 0, &from, (WX_SOCKLEN_T *) &fromlen);
|
||||||
|
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
@@ -84,9 +84,9 @@
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
/* if we use configure for MSW SOCKLEN_T will be already defined */
|
/* if we use configure for MSW WX_SOCKLEN_T will be already defined */
|
||||||
#ifndef SOCKLEN_T
|
#ifndef WX_SOCKLEN_T
|
||||||
# define SOCKLEN_T int
|
# define WX_SOCKLEN_T int
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Table of GUI-related functions. We must call them indirectly because
|
/* Table of GUI-related functions. We must call them indirectly because
|
||||||
@@ -299,7 +299,7 @@ GAddress *GSocket::GetLocal()
|
|||||||
{
|
{
|
||||||
GAddress *address;
|
GAddress *address;
|
||||||
struct sockaddr addr;
|
struct sockaddr addr;
|
||||||
SOCKLEN_T size = sizeof(addr);
|
WX_SOCKLEN_T size = sizeof(addr);
|
||||||
GSocketError err;
|
GSocketError err;
|
||||||
|
|
||||||
assert(this);
|
assert(this);
|
||||||
@@ -411,7 +411,7 @@ GSocketError GSocket::SetServer()
|
|||||||
if ((bind(m_fd, m_local->m_addr, m_local->m_len) != 0) ||
|
if ((bind(m_fd, m_local->m_addr, m_local->m_len) != 0) ||
|
||||||
(getsockname(m_fd,
|
(getsockname(m_fd,
|
||||||
m_local->m_addr,
|
m_local->m_addr,
|
||||||
(SOCKLEN_T *)&m_local->m_len) != 0) ||
|
(WX_SOCKLEN_T *)&m_local->m_len) != 0) ||
|
||||||
(listen(m_fd, 5) != 0))
|
(listen(m_fd, 5) != 0))
|
||||||
{
|
{
|
||||||
Close();
|
Close();
|
||||||
@@ -438,7 +438,7 @@ GSocket *GSocket::WaitConnection()
|
|||||||
{
|
{
|
||||||
GSocket *connection;
|
GSocket *connection;
|
||||||
struct sockaddr from;
|
struct sockaddr from;
|
||||||
SOCKLEN_T fromlen = sizeof(from);
|
WX_SOCKLEN_T fromlen = sizeof(from);
|
||||||
GSocketError err;
|
GSocketError err;
|
||||||
u_long arg = 1;
|
u_long arg = 1;
|
||||||
|
|
||||||
@@ -696,7 +696,7 @@ GSocketError GSocket::SetNonOriented()
|
|||||||
if ((bind(m_fd, m_local->m_addr, m_local->m_len) != 0) ||
|
if ((bind(m_fd, m_local->m_addr, m_local->m_len) != 0) ||
|
||||||
(getsockname(m_fd,
|
(getsockname(m_fd,
|
||||||
m_local->m_addr,
|
m_local->m_addr,
|
||||||
(SOCKLEN_T *)&m_local->m_len) != 0))
|
(WX_SOCKLEN_T *)&m_local->m_len) != 0))
|
||||||
{
|
{
|
||||||
Close();
|
Close();
|
||||||
m_error = GSOCK_IOERR;
|
m_error = GSOCK_IOERR;
|
||||||
@@ -867,7 +867,7 @@ GSocketEventFlags GSocket::Select(GSocketEventFlags flags)
|
|||||||
if (m_establishing && !m_server)
|
if (m_establishing && !m_server)
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
SOCKLEN_T len = sizeof(error);
|
WX_SOCKLEN_T len = sizeof(error);
|
||||||
|
|
||||||
m_establishing = false;
|
m_establishing = false;
|
||||||
|
|
||||||
@@ -1114,7 +1114,7 @@ int GSocket::Recv_Stream(char *buffer, int size)
|
|||||||
int GSocket::Recv_Dgram(char *buffer, int size)
|
int GSocket::Recv_Dgram(char *buffer, int size)
|
||||||
{
|
{
|
||||||
struct sockaddr from;
|
struct sockaddr from;
|
||||||
SOCKLEN_T fromlen = sizeof(from);
|
WX_SOCKLEN_T fromlen = sizeof(from);
|
||||||
int ret;
|
int ret;
|
||||||
GSocketError err;
|
GSocketError err;
|
||||||
|
|
||||||
|
@@ -114,26 +114,26 @@ int _System soclose(int);
|
|||||||
#endif
|
#endif
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
#ifndef SOCKLEN_T
|
#ifndef WX_SOCKLEN_T
|
||||||
|
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
# define SOCKLEN_T unsigned int
|
# define WX_SOCKLEN_T unsigned int
|
||||||
#else
|
#else
|
||||||
# ifdef __GLIBC__
|
# ifdef __GLIBC__
|
||||||
# if __GLIBC__ == 2
|
# if __GLIBC__ == 2
|
||||||
# define SOCKLEN_T socklen_t
|
# define WX_SOCKLEN_T socklen_t
|
||||||
# endif
|
# endif
|
||||||
# elif defined(__WXMAC__)
|
# elif defined(__WXMAC__)
|
||||||
# define SOCKLEN_T socklen_t
|
# define WX_SOCKLEN_T socklen_t
|
||||||
# else
|
# else
|
||||||
# define SOCKLEN_T int
|
# define WX_SOCKLEN_T int
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* SOCKLEN_T */
|
#endif /* SOCKLEN_T */
|
||||||
|
|
||||||
#ifndef SOCKOPTLEN_T
|
#ifndef SOCKOPTLEN_T
|
||||||
#define SOCKOPTLEN_T SOCKLEN_T
|
#define SOCKOPTLEN_T WX_SOCKLEN_T
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -414,7 +414,7 @@ GAddress *GSocket::GetLocal()
|
|||||||
{
|
{
|
||||||
GAddress *address;
|
GAddress *address;
|
||||||
struct sockaddr addr;
|
struct sockaddr addr;
|
||||||
SOCKLEN_T size = sizeof(addr);
|
WX_SOCKLEN_T size = sizeof(addr);
|
||||||
GSocketError err;
|
GSocketError err;
|
||||||
|
|
||||||
assert(this);
|
assert(this);
|
||||||
@@ -430,7 +430,7 @@ GAddress *GSocket::GetLocal()
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getsockname(m_fd, &addr, (SOCKLEN_T *) &size) < 0)
|
if (getsockname(m_fd, &addr, (WX_SOCKLEN_T *) &size) < 0)
|
||||||
{
|
{
|
||||||
m_error = GSOCK_IOERR;
|
m_error = GSOCK_IOERR;
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -532,7 +532,7 @@ GSocketError GSocket::SetServer()
|
|||||||
if ((bind(m_fd, m_local->m_addr, m_local->m_len) != 0) ||
|
if ((bind(m_fd, m_local->m_addr, m_local->m_len) != 0) ||
|
||||||
(getsockname(m_fd,
|
(getsockname(m_fd,
|
||||||
m_local->m_addr,
|
m_local->m_addr,
|
||||||
(SOCKLEN_T *) &m_local->m_len) != 0) ||
|
(WX_SOCKLEN_T *) &m_local->m_len) != 0) ||
|
||||||
(listen(m_fd, 5) != 0))
|
(listen(m_fd, 5) != 0))
|
||||||
{
|
{
|
||||||
Close();
|
Close();
|
||||||
@@ -558,7 +558,7 @@ GSocketError GSocket::SetServer()
|
|||||||
GSocket *GSocket::WaitConnection()
|
GSocket *GSocket::WaitConnection()
|
||||||
{
|
{
|
||||||
struct sockaddr from;
|
struct sockaddr from;
|
||||||
SOCKLEN_T fromlen = sizeof(from);
|
WX_SOCKLEN_T fromlen = sizeof(from);
|
||||||
GSocket *connection;
|
GSocket *connection;
|
||||||
GSocketError err;
|
GSocketError err;
|
||||||
int arg = 1;
|
int arg = 1;
|
||||||
@@ -589,7 +589,7 @@ GSocket *GSocket::WaitConnection()
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
connection->m_fd = accept(m_fd, &from, (SOCKLEN_T *) &fromlen);
|
connection->m_fd = accept(m_fd, &from, (WX_SOCKLEN_T *) &fromlen);
|
||||||
|
|
||||||
/* Reenable CONNECTION events */
|
/* Reenable CONNECTION events */
|
||||||
Enable(GSOCK_CONNECTION);
|
Enable(GSOCK_CONNECTION);
|
||||||
@@ -838,7 +838,7 @@ GSocketError GSocket::SetNonOriented()
|
|||||||
if ((bind(m_fd, m_local->m_addr, m_local->m_len) != 0) ||
|
if ((bind(m_fd, m_local->m_addr, m_local->m_len) != 0) ||
|
||||||
(getsockname(m_fd,
|
(getsockname(m_fd,
|
||||||
m_local->m_addr,
|
m_local->m_addr,
|
||||||
(SOCKLEN_T *) &m_local->m_len) != 0))
|
(WX_SOCKLEN_T *) &m_local->m_len) != 0))
|
||||||
{
|
{
|
||||||
Close();
|
Close();
|
||||||
m_error = GSOCK_IOERR;
|
m_error = GSOCK_IOERR;
|
||||||
@@ -1331,7 +1331,7 @@ int GSocket::Recv_Stream(char *buffer, int size)
|
|||||||
int GSocket::Recv_Dgram(char *buffer, int size)
|
int GSocket::Recv_Dgram(char *buffer, int size)
|
||||||
{
|
{
|
||||||
struct sockaddr from;
|
struct sockaddr from;
|
||||||
SOCKLEN_T fromlen = sizeof(from);
|
WX_SOCKLEN_T fromlen = sizeof(from);
|
||||||
int ret;
|
int ret;
|
||||||
GSocketError err;
|
GSocketError err;
|
||||||
|
|
||||||
@@ -1339,7 +1339,7 @@ int GSocket::Recv_Dgram(char *buffer, int size)
|
|||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
ret = recvfrom(m_fd, buffer, size, 0, &from, (SOCKLEN_T *) &fromlen);
|
ret = recvfrom(m_fd, buffer, size, 0, &from, (WX_SOCKLEN_T *) &fromlen);
|
||||||
} while (ret == -1 && errno == EINTR); /* Loop until not interrupted */
|
} while (ret == -1 && errno == EINTR); /* Loop until not interrupted */
|
||||||
|
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
|
Reference in New Issue
Block a user