X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ba681060f36767a2682b8547871af2c6f8159955..e370f4029e2fde627fc13c98fb82fe63894e4f89:/src/common/socket.cpp diff --git a/src/common/socket.cpp b/src/common/socket.cpp index e4d22c8e4a..9d3dffd789 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; @@ -358,6 +358,7 @@ bool wxSocketBase::Close() wxSocketBase& wxSocketBase::Read(char* buffer, size_t nbytes) { m_lcount = GetPushback(buffer, nbytes, FALSE); + nbytes -= m_lcount; // If we have got the whole needed buffer or if we don't want to // wait then it returns immediately. @@ -440,9 +441,9 @@ wxSocketBase& wxSocketBase::WriteMsg(const char *buffer, size_t nbytes) SockMsg msg; // warning about 'cast truncates constant value' -#ifdef _MSC_VER +#ifdef __VISUALC__ #pragma warning(disable: 4310) -#endif // _MSC_VER +#endif // __VISUALC__ msg.sig[0] = (char) 0xad; msg.sig[1] = (char) 0xde; @@ -468,9 +469,9 @@ wxSocketBase& wxSocketBase::WriteMsg(const char *buffer, size_t nbytes) return *this; -#ifdef _MSC_VER +#ifdef __VISUALC__ #pragma warning(default: 4310) -#endif // _MSC_VER +#endif // __VISUALC__ } wxSocketBase& wxSocketBase::Unread(const char *buffer, size_t nbytes)