X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f71bb8efc323a4d6e430a0122e34cec56d489d27..36f1f456497faa46bfdaf3af9936bb4f7498a6b4:/src/unix/gsocket.cpp diff --git a/src/unix/gsocket.cpp b/src/unix/gsocket.cpp index e9796134ec..dd874ef757 100644 --- a/src/unix/gsocket.cpp +++ b/src/unix/gsocket.cpp @@ -101,6 +101,9 @@ int _System soclose(int); #ifdef sgi # include #endif +#ifdef _AIX +# include +#endif #include #ifndef SOCKLEN_T @@ -117,14 +120,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 +583,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,7 +698,7 @@ 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, (char*) &error, &len); @@ -983,7 +983,7 @@ 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; @@ -1138,7 +1138,7 @@ void GSocket::UnsetCallback(GSocketEventFlags flags) GSocketError GSocket::GetSockOpt(int level, int optname, void *optval, int *optlen) { - if (getsockopt(m_fd, level, optname, (char*)optval, (SOCKLEN_T*)optlen) == 0) + if (getsockopt(m_fd, level, optname, (char*)optval, (SOCKOPTLEN_T*)optlen) == 0) { return GSOCK_NOERROR; } @@ -1405,7 +1405,7 @@ void GSocket::Detected_Write() if (m_establishing && !m_server) { int error; - SOCKLEN_T len = sizeof(error); + SOCKOPTLEN_T len = sizeof(error); m_establishing = false;