X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e8b7a986a6e8257dbcf2c04183ec2924e7906fd4..d3e780ecdf69233c872d51216eedbc64a1b6db25:/src/unix/gsocket.c diff --git a/src/unix/gsocket.c b/src/unix/gsocket.c index 396a93641d..16eae12743 100644 --- a/src/unix/gsocket.c +++ b/src/unix/gsocket.c @@ -261,7 +261,10 @@ GSocket *GSocket_new(void) void GSocket_close(GSocket *socket) { _GSocket_Disable_Events(socket); + /* gsockosx.c calls CFSocketInvalidate which closes the socket for us */ +#if !(defined(__DARWIN__) && (defined(__WXMAC__) || defined(__WXCOCOA__))) close(socket->m_fd); +#endif socket->m_fd = INVALID_SOCKET; } @@ -269,20 +272,12 @@ void GSocket_destroy(GSocket *socket) { assert(socket != NULL); - /* When using CFSocket we MUST invalidate before closing the fd */ -#ifdef __DARWIN__ - /* Per-socket GUI-specific cleanup */ - _GSocket_GUI_Destroy_Socket(socket); -#endif - /* Check that the socket is really shutdowned */ if (socket->m_fd != INVALID_SOCKET) GSocket_Shutdown(socket); -#ifndef __DARWIN__ /* Per-socket GUI-specific cleanup */ _GSocket_GUI_Destroy_Socket(socket); -#endif /* Destroy private addresses */ if (socket->m_local) @@ -1621,8 +1616,10 @@ GSocketError GAddress_INET_SetHostName(GAddress *address, const char *hostname) { #else /* Use gethostbyname by default */ - int val = 1; //VA doesn't like constants in conditional expressions at all +#ifndef __WXMAC__ + int val = 1; /* VA doesn't like constants in conditional expressions */ if (val) +#endif { #endif struct in_addr *array_addr;