X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ee4c6942b49d6ea13258437466c5735b1ba3ec6a..d79b79b5e8f35e92fbbf0d74c3514dc37642e5aa:/src/common/socket.cpp diff --git a/src/common/socket.cpp b/src/common/socket.cpp index 9b7fbe2ecd..56c601c617 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -97,7 +97,7 @@ void wxMacProcessEvents() ; #include #include -#ifdef _MSC_VER +#ifdef __VISUALC__ #include #endif @@ -157,7 +157,7 @@ void wxMacProcessEvents() ; // implementations (such as PC-NFS) will require you to include this // or a similar routine (see appendix in WinSock doc or help file). -#if defined( NEED_WSAFDIsSet ) || defined( _MSC_VER ) +#if defined( NEED_WSAFDIsSet ) || defined( __VISUALC__ ) int PASCAL FAR __WSAFDIsSet(SOCKET fd, fd_set FAR *set) { int i = set->fd_count; @@ -185,6 +185,10 @@ int PASCAL FAR __WSAFDIsSet(SOCKET fd, fd_set FAR *set) // Some patch ///// END ///////////////////////////////////////////////////////////////////////////// +#ifdef GetClassInfo +#undef GetClassInfo +#endif + // -------------------------------------------------------------- // Module // -------------------------------------------------------------- @@ -435,6 +439,11 @@ wxSocketBase& wxSocketBase::WriteMsg(const char *buffer, size_t nbytes) { SockMsg msg; + // warning about 'cast truncates constant value' +#ifdef __VISUALC__ + #pragma warning(disable: 4310) +#endif // __VISUALC__ + msg.sig[0] = (char) 0xad; msg.sig[1] = (char) 0xde; msg.sig[2] = (char) 0xed; @@ -458,6 +467,10 @@ wxSocketBase& wxSocketBase::WriteMsg(const char *buffer, size_t nbytes) Write((char *)&msg, sizeof(msg)); return *this; + +#ifdef __VISUALC__ + #pragma warning(default: 4310) +#endif // __VISUALC__ } wxSocketBase& wxSocketBase::Unread(const char *buffer, size_t nbytes) @@ -518,11 +531,10 @@ void wxSocketBase::Discard() // Meanwhile, if your compiler complains about socklen_t, // switch lines below. -#if defined(__LINUX__) -// #if 0 -#define wxSOCKET_INT socklen_t +#if wxHAVE_GLIBC2 +# define wxSOCKET_INT socklen_t #else -#define wxSOCKET_INT int +# define wxSOCKET_INT int #endif // -------------------------------------------------------------- @@ -1599,7 +1611,12 @@ LRESULT APIENTRY _EXPORT wxSocketHandlerWndProc(HWND hWnd, UINT message, case FD_CONNECT: sk_req = wxSocketBase::EVT_CONNECT; break; + + default: + wxFAIL_MSG("invalid socket event"); + return (LRESULT)0; } + sock->OnRequest(sk_req); return (LRESULT)0;