X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b715de93a6d773c9ff0c32340f734e27469f2e71..f0bce4d4e075056231e5a0ce7f338a9822083fc3:/src/unix/gsocket.cpp diff --git a/src/unix/gsocket.cpp b/src/unix/gsocket.cpp index d7bb9362d3..28e293681c 100644 --- a/src/unix/gsocket.cpp +++ b/src/unix/gsocket.cpp @@ -117,14 +117,12 @@ int _System soclose(int); # endif #endif -#else - /* undefine for OSX - its really an int */ -# ifdef __DARWIN__ -# undef SOCKLEN_T -# define SOCKLEN_T int -# endif #endif /* SOCKLEN_T */ +#ifndef SOCKOPTLEN_T +#define SOCKOPTLEN_T SOCKLEN_T +#endif + /* * MSW defines this, Unices don't. */ @@ -582,7 +580,6 @@ GSocket *GSocket::WaitConnection() err = _GAddress_translate_from(connection->m_peer, &from, fromlen); if (err != GSOCK_NOERROR) { - GAddress_destroy(connection->m_peer); delete connection; m_error = err; return NULL; @@ -698,9 +695,9 @@ GSocketError GSocket::Connect(GSocketStream stream) else { int error; - SOCKLEN_T len = sizeof(error); + SOCKOPTLEN_T len = sizeof(error); - getsockopt(m_fd, SOL_SOCKET, SO_ERROR, (void*) &error, &len); + getsockopt(m_fd, SOL_SOCKET, SO_ERROR, (char*) &error, &len); if (!error) return GSOCK_NOERROR; @@ -983,11 +980,11 @@ GSocketEventFlags GSocket::Select(GSocketEventFlags flags) if (m_establishing && !m_server) { int error; - SOCKLEN_T len = sizeof(error); + SOCKOPTLEN_T len = sizeof(error); m_establishing = false; - getsockopt(m_fd, SOL_SOCKET, SO_ERROR, (void*)&error, &len); + getsockopt(m_fd, SOL_SOCKET, SO_ERROR, (char*)&error, &len); if (error) { @@ -1138,7 +1135,7 @@ void GSocket::UnsetCallback(GSocketEventFlags flags) GSocketError GSocket::GetSockOpt(int level, int optname, void *optval, int *optlen) { - if (getsockopt(m_fd, level, optname, optval, (SOCKLEN_T*)optlen) == 0) + if (getsockopt(m_fd, level, optname, (char*)optval, (SOCKOPTLEN_T*)optlen) == 0) { return GSOCK_NOERROR; } @@ -1148,7 +1145,7 @@ GSocketError GSocket::GetSockOpt(int level, int optname, GSocketError GSocket::SetSockOpt(int level, int optname, const void *optval, int optlen) { - if (setsockopt(m_fd, level, optname, optval, optlen) == 0) + if (setsockopt(m_fd, level, optname, (const char*)optval, optlen) == 0) { return GSOCK_NOERROR; } @@ -1405,11 +1402,11 @@ void GSocket::Detected_Write() if (m_establishing && !m_server) { int error; - SOCKLEN_T len = sizeof(error); + SOCKOPTLEN_T len = sizeof(error); m_establishing = false; - getsockopt(m_fd, SOL_SOCKET, SO_ERROR, (void*)&error, &len); + getsockopt(m_fd, SOL_SOCKET, SO_ERROR, (char*)&error, &len); if (error) {