5252# define fd_close (sd ) close(sd)
5353#endif
5454
55- #ifdef FEAT_GUI_W32
56- extern HWND s_hwnd ; /* Gvim's Window handle */
57- #endif
58-
5955#ifdef WIN32
6056 static int
6157fd_read (sock_T fd , char * buf , size_t len )
@@ -295,9 +291,6 @@ add_channel(void)
295291#endif
296292#ifdef FEAT_GUI_GTK
297293 channel -> ch_part [part ].ch_inputHandler = 0 ;
298- #endif
299- #ifdef FEAT_GUI_W32
300- channel -> ch_part [part ].ch_inputHandler = -1 ;
301294#endif
302295 channel -> ch_part [part ].ch_timeout = 2000 ;
303296 }
@@ -421,15 +414,6 @@ channel_gui_register_one(channel_T *channel, int part)
421414 messageFromNetbeans ,
422415 (gpointer )(long )channel -> ch_part [part ].ch_fd );
423416# endif
424- # else
425- # ifdef FEAT_GUI_W32
426- /* Tell Windows we are interested in receiving message when there
427- * is input on the editor connection socket. */
428- if (channel -> ch_part [part ].ch_inputHandler == -1 )
429- channel -> ch_part [part ].ch_inputHandler = WSAAsyncSelect (
430- channel -> ch_part [part ].ch_fd ,
431- s_hwnd , WM_NETBEANS , FD_READ );
432- # endif
433417# endif
434418# endif
435419}
@@ -491,14 +475,6 @@ channel_gui_unregister(channel_T *channel)
491475# endif
492476 channel -> ch_part [part ].ch_inputHandler = 0 ;
493477 }
494- # else
495- # ifdef FEAT_GUI_W32
496- if (channel -> ch_part [part ].ch_inputHandler == 0 )
497- {
498- WSAAsyncSelect (channel -> ch_part [part ].ch_fd , s_hwnd , 0 , 0 );
499- channel -> ch_part [part ].ch_inputHandler = -1 ;
500- }
501- # endif
502478# endif
503479# endif
504480 }
@@ -1630,7 +1606,6 @@ channel_free_all(void)
16301606/*
16311607 * Check for reading from "fd" with "timeout" msec.
16321608 * Return FAIL when there is nothing to read.
1633- * Always returns OK for FEAT_GUI_W32.
16341609 */
16351610 static int
16361611channel_wait (channel_T * channel , sock_T fd , int timeout )
@@ -1662,12 +1637,7 @@ channel_wait(channel_T *channel, sock_T fd, int timeout)
16621637 else
16631638#endif
16641639 {
1665- #if defined(FEAT_GUI_W32 )
1666- /* Can't check socket for Win32 GUI, always return OK. */
1667- ch_log (channel , "Can't check, assuming there is something to read" );
1668- return OK ;
1669- #else
1670- # if defined(HAVE_SELECT )
1640+ #if defined(HAVE_SELECT )
16711641 struct timeval tval ;
16721642 fd_set rfds ;
16731643 int ret ;
@@ -1679,23 +1649,22 @@ channel_wait(channel_T *channel, sock_T fd, int timeout)
16791649 for (;;)
16801650 {
16811651 ret = select ((int )fd + 1 , & rfds , NULL , NULL , & tval );
1682- # ifdef EINTR
1652+ # ifdef EINTR
16831653 SOCK_ERRNO ;
16841654 if (ret == -1 && errno == EINTR )
16851655 continue ;
1686- # endif
1656+ # endif
16871657 if (ret > 0 )
16881658 return OK ;
16891659 break ;
16901660 }
1691- # else
1661+ #else
16921662 struct pollfd fds ;
16931663
16941664 fds .fd = fd ;
16951665 fds .events = POLLIN ;
16961666 if (poll (& fds , 1 , timeout ) > 0 )
16971667 return OK ;
1698- # endif
16991668#endif
17001669 }
17011670 ch_log (channel , "Nothing to read" );
@@ -1764,16 +1733,6 @@ channel_read(channel_T *channel, int part, char *func)
17641733 if (len < MAXMSGSIZE )
17651734 break ; /* did read everything that's available */
17661735 }
1767- #ifdef FEAT_GUI_W32
1768- if (use_socket && len == SOCKET_ERROR )
1769- {
1770- /* For Win32 GUI channel_wait() always returns OK and we handle the
1771- * situation that there is nothing to read here.
1772- * TODO: how about a timeout? */
1773- if (WSAGetLastError () == WSAEWOULDBLOCK )
1774- return ;
1775- }
1776- #endif
17771736
17781737 /* Reading a disconnection (readlen == 0), or an error.
17791738 * TODO: call error callback. */
@@ -1970,17 +1929,12 @@ channel_handle_events(void)
19701929
19711930 for (channel = first_channel ; channel != NULL ; channel = channel -> ch_next )
19721931 {
1973- # ifdef FEAT_GUI_W32
1974- /* only check the pipes */
1975- for (part = PART_OUT ; part <= PART_ERR ; ++ part )
1976- # else
1977- # ifdef CHANNEL_PIPES
1932+ # ifdef CHANNEL_PIPES
19781933 /* check the socket and pipes */
19791934 for (part = PART_SOCK ; part <= PART_ERR ; ++ part )
1980- # else
1935+ # else
19811936 /* only check the socket */
19821937 part = PART_SOCK ;
1983- # endif
19841938# endif
19851939 {
19861940 fd = channel -> ch_part [part ].ch_fd ;
0 commit comments