0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 7.4.1195

Problem:    The channel feature does not work in the MS-Windows console.
Solution:   Add win32 console support. (Yasuhiro Matsumoto)
This commit is contained in:
Bram Moolenaar
2016-01-29 21:11:25 +01:00
parent 83162468b3
commit f12d983dea
8 changed files with 53 additions and 30 deletions

View File

@@ -161,7 +161,9 @@ extern HWND s_hwnd;
static HWND s_hwnd = 0; /* console window handle, set by GetConsoleHwnd() */
#endif
extern int WSInitialized;
#ifdef FEAT_CHANNEL
int WSInitialized = FALSE; /* WinSock is initialized */
#endif
/* Don't generate prototypes here, because some systems do have these
* functions. */
@@ -3093,3 +3095,22 @@ theend:
}
#endif /* defined(FEAT_GUI) || defined(FEAT_PRINTER) */
#if defined(FEAT_CHANNEL) || defined(PROTO)
/*
* Initialize the Winsock dll.
*/
void
channel_init_winsock()
{
WSADATA wsaData;
int wsaerr;
if (WSInitialized)
return;
wsaerr = WSAStartup(MAKEWORD(2, 2), &wsaData);
if (wsaerr == 0)
WSInitialized = TRUE;
}
#endif