]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/socket.cpp
*** empty log message ***
[wxWidgets.git] / src / common / socket.cpp
index ef8e6fd1e979fe7a26b6c0392e7e12eb9d1d64fb..56c601c617765577035866db3ca02cb0673bbef5 100644 (file)
@@ -97,7 +97,7 @@ void wxMacProcessEvents() ;
 #include <signal.h>
 #include <errno.h>
 
-#ifdef _MSC_VER
+#ifdef __VISUALC__
 #include <io.h>
 #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)
@@ -1598,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;