1
0
forked from aniani/vim

patch 9.0.0496: no good reason to keep supporting Windows-XP

Problem:    No good reason to keep supporting Windows-XP.
Solution:   Drop Windows-XP support. (Ken Takata, closes #11089)
This commit is contained in:
K.Takata
2022-09-18 12:25:49 +01:00
committed by Bram Moolenaar
parent dbbb02bc77
commit 27b53be3a6
10 changed files with 70 additions and 131 deletions

View File

@@ -243,27 +243,6 @@ static char_u *exe_path = NULL;
static BOOL win8_or_later = FALSE;
#if !defined(FEAT_GUI_MSWIN) || defined(VIMDLL)
// Dynamic loading for portability
typedef struct _DYN_CONSOLE_SCREEN_BUFFER_INFOEX
{
ULONG cbSize;
COORD dwSize;
COORD dwCursorPosition;
WORD wAttributes;
SMALL_RECT srWindow;
COORD dwMaximumWindowSize;
WORD wPopupAttributes;
BOOL bFullscreenSupported;
COLORREF ColorTable[16];
} DYN_CONSOLE_SCREEN_BUFFER_INFOEX, *PDYN_CONSOLE_SCREEN_BUFFER_INFOEX;
typedef BOOL (WINAPI *PfnGetConsoleScreenBufferInfoEx)(HANDLE, PDYN_CONSOLE_SCREEN_BUFFER_INFOEX);
static PfnGetConsoleScreenBufferInfoEx pGetConsoleScreenBufferInfoEx;
typedef BOOL (WINAPI *PfnSetConsoleScreenBufferInfoEx)(HANDLE, PDYN_CONSOLE_SCREEN_BUFFER_INFOEX);
static PfnSetConsoleScreenBufferInfoEx pSetConsoleScreenBufferInfoEx;
static BOOL has_csbiex = FALSE;
#endif
/*
* Get version number including build number
*/
@@ -7882,30 +7861,13 @@ vtp_flag_init(void)
static void
vtp_init(void)
{
HMODULE hKerneldll;
DYN_CONSOLE_SCREEN_BUFFER_INFOEX csbi;
CONSOLE_SCREEN_BUFFER_INFOEX csbi;
# ifdef FEAT_TERMGUICOLORS
COLORREF fg;
# endif
// Use functions supported from Vista
hKerneldll = GetModuleHandle("kernel32.dll");
if (hKerneldll != NULL)
{
pGetConsoleScreenBufferInfoEx =
(PfnGetConsoleScreenBufferInfoEx)GetProcAddress(
hKerneldll, "GetConsoleScreenBufferInfoEx");
pSetConsoleScreenBufferInfoEx =
(PfnSetConsoleScreenBufferInfoEx)GetProcAddress(
hKerneldll, "SetConsoleScreenBufferInfoEx");
if (pGetConsoleScreenBufferInfoEx != NULL
&& pSetConsoleScreenBufferInfoEx != NULL)
has_csbiex = TRUE;
}
csbi.cbSize = sizeof(csbi);
if (has_csbiex)
pGetConsoleScreenBufferInfoEx(g_hConOut, &csbi);
GetConsoleScreenBufferInfoEx(g_hConOut, &csbi);
save_console_bg_rgb = (guicolor_T)csbi.ColorTable[g_color_index_bg];
save_console_fg_rgb = (guicolor_T)csbi.ColorTable[g_color_index_fg];
store_console_bg_rgb = save_console_bg_rgb;
@@ -8134,7 +8096,7 @@ ctermtoxterm(
set_console_color_rgb(void)
{
# ifdef FEAT_TERMGUICOLORS
DYN_CONSOLE_SCREEN_BUFFER_INFOEX csbi;
CONSOLE_SCREEN_BUFFER_INFOEX csbi;
guicolor_T fg, bg;
int ctermfg, ctermbg;
@@ -8154,8 +8116,7 @@ set_console_color_rgb(void)
bg = (GetRValue(bg) << 16) | (GetGValue(bg) << 8) | GetBValue(bg);
csbi.cbSize = sizeof(csbi);
if (has_csbiex)
pGetConsoleScreenBufferInfoEx(g_hConOut, &csbi);
GetConsoleScreenBufferInfoEx(g_hConOut, &csbi);
csbi.cbSize = sizeof(csbi);
csbi.srWindow.Right += 1;
@@ -8164,8 +8125,7 @@ set_console_color_rgb(void)
store_console_fg_rgb = csbi.ColorTable[g_color_index_fg];
csbi.ColorTable[g_color_index_bg] = (COLORREF)bg;
csbi.ColorTable[g_color_index_fg] = (COLORREF)fg;
if (has_csbiex)
pSetConsoleScreenBufferInfoEx(g_hConOut, &csbi);
SetConsoleScreenBufferInfoEx(g_hConOut, &csbi);
# endif
}
@@ -8231,22 +8191,20 @@ get_default_console_color(
reset_console_color_rgb(void)
{
# ifdef FEAT_TERMGUICOLORS
DYN_CONSOLE_SCREEN_BUFFER_INFOEX csbi;
CONSOLE_SCREEN_BUFFER_INFOEX csbi;
if (USE_WT)
return;
csbi.cbSize = sizeof(csbi);
if (has_csbiex)
pGetConsoleScreenBufferInfoEx(g_hConOut, &csbi);
GetConsoleScreenBufferInfoEx(g_hConOut, &csbi);
csbi.cbSize = sizeof(csbi);
csbi.srWindow.Right += 1;
csbi.srWindow.Bottom += 1;
csbi.ColorTable[g_color_index_bg] = (COLORREF)store_console_bg_rgb;
csbi.ColorTable[g_color_index_fg] = (COLORREF)store_console_fg_rgb;
if (has_csbiex)
pSetConsoleScreenBufferInfoEx(g_hConOut, &csbi);
SetConsoleScreenBufferInfoEx(g_hConOut, &csbi);
# endif
}
@@ -8257,19 +8215,17 @@ reset_console_color_rgb(void)
restore_console_color_rgb(void)
{
# ifdef FEAT_TERMGUICOLORS
DYN_CONSOLE_SCREEN_BUFFER_INFOEX csbi;
CONSOLE_SCREEN_BUFFER_INFOEX csbi;
csbi.cbSize = sizeof(csbi);
if (has_csbiex)
pGetConsoleScreenBufferInfoEx(g_hConOut, &csbi);
GetConsoleScreenBufferInfoEx(g_hConOut, &csbi);
csbi.cbSize = sizeof(csbi);
csbi.srWindow.Right += 1;
csbi.srWindow.Bottom += 1;
csbi.ColorTable[g_color_index_bg] = (COLORREF)save_console_bg_rgb;
csbi.ColorTable[g_color_index_fg] = (COLORREF)save_console_fg_rgb;
if (has_csbiex)
pSetConsoleScreenBufferInfoEx(g_hConOut, &csbi);
SetConsoleScreenBufferInfoEx(g_hConOut, &csbi);
# endif
}