X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6a9c0257704e3402b1228c2d0f368ae47769c7b..dd779a9e66c640907048ab02cb4a853ae45ea94c:/src/msw/gsocket.c diff --git a/src/msw/gsocket.c b/src/msw/gsocket.c index 50121a0900..4d6e01f624 100644 --- a/src/msw/gsocket.c +++ b/src/msw/gsocket.c @@ -3,7 +3,7 @@ * Name: gsocket.c * Author: Guillermo Rodriguez Garcia * Purpose: GSocket main MSW file - * Licence: The wxWindows licence + * Licence: The wxWidgets licence * CVSID: $Id$ * ------------------------------------------------------------------------- */ @@ -27,13 +27,17 @@ # pragma warning(disable:4100) #ifdef __WXWINCE__ - /* - "unreferenced inline function has been removed": this is not - suppressed by push above as it is given at the end of the - compilation unit - */ -# pragma warning(disable:4514) -#endif /* __WXWINCE__ */ + /* windows.h results in tons of warnings at max warning level */ +# ifdef _MSC_VER +# pragma warning(push, 1) +# endif +# include +# ifdef _MSC_VER +# pragma warning(pop) +# pragma warning(disable:4514) +# endif +#endif + #endif /* _MSC_VER */ #include @@ -780,7 +784,7 @@ GSocketEventFlags GSocket_Select(GSocket *socket, GSocketEventFlags flags) FD_ZERO(&writefds); FD_ZERO(&exceptfds); FD_SET(socket->m_fd, &readfds); - if (flags & GSOCK_OUTPUT_FLAG || flags & GSOCK_CONNECTION_FLAG) + if (flags & GSOCK_OUTPUT_FLAG || flags & GSOCK_CONNECTION_FLAG) FD_SET(socket->m_fd, &writefds); FD_SET(socket->m_fd, &exceptfds); @@ -799,7 +803,7 @@ GSocketEventFlags GSocket_Select(GSocket *socket, GSocketEventFlags flags) /* Try select now */ if (select(socket->m_fd + 1, &readfds, &writefds, &exceptfds, - &socket->m_timeout) <= 0) + &socket->m_timeout) <= 0) { /* What to do here? */ return (result & flags); @@ -1361,7 +1365,7 @@ GSocketError GAddress_INET_SetHostAddress(GAddress *address, CHECK_ADDRESS(address, INET); addr = &(((struct sockaddr_in *)address->m_addr)->sin_addr); - addr->s_addr = hostaddr; + addr->s_addr = htonl(hostaddr);; return GSOCK_NOERROR; } @@ -1450,7 +1454,7 @@ unsigned long GAddress_INET_GetHostAddress(GAddress *address) addr = (struct sockaddr_in *)address->m_addr; - return addr->sin_addr.s_addr; + return ntohl(addr->sin_addr.s_addr); } unsigned short GAddress_INET_GetPort(GAddress *address)