]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/gsocket.c
remove 'extern' from IsKeyDown,... for bcc
[wxWidgets.git] / src / msw / gsocket.c
index 2f04a9473cf430b145401ecff238766b47baa2f4..66dc5acfc64060b81381a7ecfb72c664d3ae57fb 100644 (file)
 #include <ctype.h>
 #include <winsock.h>
 
+/* if we use configure for MSW SOCKLEN_T will be already defined */
+#ifndef SOCKLEN_T
 #define SOCKLEN_T  int
+#endif
+
 #define CLASSNAME  "_GSocket_Internal_Window_Class"
 #define WINDOWNAME "_GSocket_Internal_Window_Name"
 
@@ -766,20 +770,9 @@ int GSocket_Write(GSocket *socket, const char *buffer, int size)
  */
 GSocketEventFlags GSocket_Select(GSocket *socket, GSocketEventFlags flags)
 {
-  GSocketEventFlags result = 0;
-  char c;
-
   assert(socket != NULL);
 
-  result = flags & socket->m_detected;
-
-  if ((flags & GSOCK_INPUT_FLAG) &&
-      (recv(socket->m_fd, &c, 1, MSG_PEEK) > 0))
-  {
-    result |= GSOCK_INPUT_FLAG;
-  }
-
-  return result;
+  return flags & socket->m_detected;
 }
 
 /* Attributes */
@@ -1041,17 +1034,14 @@ GSocketError _GSocket_Connect_Timeout(GSocket *socket)
   fd_set writefds;
   fd_set exceptfds;
 
-  if (!socket->m_non_blocking)
+  FD_ZERO(&writefds);
+  FD_ZERO(&exceptfds);
+  FD_SET(socket->m_fd, &writefds);
+  FD_SET(socket->m_fd, &exceptfds);
+  if (select(0, NULL, &writefds, &exceptfds, &socket->m_timeout) == 0)
   {
-    FD_ZERO(&writefds);
-    FD_ZERO(&exceptfds);
-    FD_SET(socket->m_fd, &writefds);
-    FD_SET(socket->m_fd, &exceptfds);
-    if (select(0, NULL, &writefds, &exceptfds, &socket->m_timeout) == 0)
-    {
-      socket->m_error = GSOCK_TIMEDOUT;
-      return GSOCK_TIMEDOUT;
-    }
+    socket->m_error = GSOCK_TIMEDOUT;
+    return GSOCK_TIMEDOUT;
   }
   if (!FD_ISSET(socket->m_fd, &writefds))
   {