Mercurial > vim
comparison src/os_mswin.c @ 7797:0d46cea25641 v7.4.1195
commit https://github.com/vim/vim/commit/f12d983deab06b0408781d7a6c2f8970d765b723
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jan 29 21:11:25 2016 +0100
patch 7.4.1195
Problem: The channel feature does not work in the MS-Windows console.
Solution: Add win32 console support. (Yasuhiro Matsumoto)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 29 Jan 2016 21:15:05 +0100 |
parents | 6069f43cea4e |
children | c079097365f3 |
comparison
equal
deleted
inserted
replaced
7796:acda999cbbb3 | 7797:0d46cea25641 |
---|---|
159 extern HWND s_hwnd; | 159 extern HWND s_hwnd; |
160 #else | 160 #else |
161 static HWND s_hwnd = 0; /* console window handle, set by GetConsoleHwnd() */ | 161 static HWND s_hwnd = 0; /* console window handle, set by GetConsoleHwnd() */ |
162 #endif | 162 #endif |
163 | 163 |
164 extern int WSInitialized; | 164 #ifdef FEAT_CHANNEL |
165 int WSInitialized = FALSE; /* WinSock is initialized */ | |
166 #endif | |
165 | 167 |
166 /* Don't generate prototypes here, because some systems do have these | 168 /* Don't generate prototypes here, because some systems do have these |
167 * functions. */ | 169 * functions. */ |
168 #if defined(__GNUC__) && !defined(PROTO) | 170 #if defined(__GNUC__) && !defined(PROTO) |
169 # ifndef __MINGW32__ | 171 # ifndef __MINGW32__ |
3091 | 3093 |
3092 return ret; | 3094 return ret; |
3093 } | 3095 } |
3094 | 3096 |
3095 #endif /* defined(FEAT_GUI) || defined(FEAT_PRINTER) */ | 3097 #endif /* defined(FEAT_GUI) || defined(FEAT_PRINTER) */ |
3098 | |
3099 #if defined(FEAT_CHANNEL) || defined(PROTO) | |
3100 /* | |
3101 * Initialize the Winsock dll. | |
3102 */ | |
3103 void | |
3104 channel_init_winsock() | |
3105 { | |
3106 WSADATA wsaData; | |
3107 int wsaerr; | |
3108 | |
3109 if (WSInitialized) | |
3110 return; | |
3111 | |
3112 wsaerr = WSAStartup(MAKEWORD(2, 2), &wsaData); | |
3113 if (wsaerr == 0) | |
3114 WSInitialized = TRUE; | |
3115 } | |
3116 #endif |