diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-01-29 21:11:25 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-01-29 21:11:25 +0100 |
commit | f12d983deab06b0408781d7a6c2f8970d765b723 (patch) | |
tree | 50d51bd7d02ffaebeba71a2faecb0380a4a04f84 /src/os_mswin.c | |
parent | 83162468b3c8722fffea033d3de144cd4191472a (diff) | |
download | vim-git-f12d983deab06b0408781d7a6c2f8970d765b723.tar.gz |
patch 7.4.1195v7.4.1195
Problem: The channel feature does not work in the MS-Windows console.
Solution: Add win32 console support. (Yasuhiro Matsumoto)
Diffstat (limited to 'src/os_mswin.c')
-rw-r--r-- | src/os_mswin.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/os_mswin.c b/src/os_mswin.c index ed7aa834d..16268920e 100644 --- a/src/os_mswin.c +++ b/src/os_mswin.c @@ -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 |