0
0
mirror of https://github.com/vim/vim.git synced 2025-09-30 04:44:14 -04:00

patch 8.0.1118: FEAT_WINDOWS adds a lot of #ifdefs

Problem:    FEAT_WINDOWS adds a lot of #ifdefs while it is nearly always
            enabled and only adds 7% to the binary size of the tiny build.
Solution:   Graduate FEAT_WINDOWS.
This commit is contained in:
Bram Moolenaar
2017-09-16 20:54:51 +02:00
parent e738a1a033
commit 4033c55eca
57 changed files with 238 additions and 1590 deletions

View File

@@ -2947,13 +2947,11 @@ _OnActivateApp(
return MyWindowProc(hwnd, WM_ACTIVATEAPP, fActivate, (DWORD)dwThreadId);
}
#if defined(FEAT_WINDOWS) || defined(PROTO)
void
gui_mch_destroy_scrollbar(scrollbar_T *sb)
{
DestroyWindow(sb->id);
}
#endif
/*
* Get current mouse coordinates in text window.
@@ -3785,12 +3783,11 @@ _OnDropFiles(
HWND hwnd UNUSED,
HDROP hDrop)
{
#ifdef FEAT_WINDOWS
# define BUFPATHLEN _MAX_PATH
# define DRAGQVAL 0xFFFFFFFF
# ifdef FEAT_MBYTE
#define BUFPATHLEN _MAX_PATH
#define DRAGQVAL 0xFFFFFFFF
#ifdef FEAT_MBYTE
WCHAR wszFile[BUFPATHLEN];
# endif
#endif
char szFile[BUFPATHLEN];
UINT cFiles = DragQueryFile(hDrop, DRAGQVAL, NULL, 0);
UINT i;
@@ -3811,11 +3808,11 @@ _OnDropFiles(
if (fnames != NULL)
for (i = 0; i < cFiles; ++i)
{
# ifdef FEAT_MBYTE
#ifdef FEAT_MBYTE
if (DragQueryFileW(hDrop, i, wszFile, BUFPATHLEN) > 0)
fnames[i] = utf16_to_enc(wszFile, NULL);
else
# endif
#endif
{
DragQueryFile(hDrop, i, szFile, BUFPATHLEN);
fnames[i] = vim_strsave((char_u *)szFile);
@@ -3837,7 +3834,6 @@ _OnDropFiles(
s_need_activate = TRUE;
}
#endif
}
static int
@@ -5463,9 +5459,7 @@ gui_mch_init(void)
#endif
s_hdc = GetDC(s_textArea);
#ifdef FEAT_WINDOWS
DragAcceptFiles(s_hwnd, TRUE);
#endif
/* Do we need to bother with this? */
/* m_fMouseAvail = GetSystemMetrics(SM_MOUSEPRESENT); */
@@ -5781,7 +5775,7 @@ _OnImeNotify(HWND hWnd, DWORD dwCommand, DWORD dwData UNUSED)
State &= ~LANGMAP;
if (State & INSERT)
{
#if defined(FEAT_WINDOWS) && defined(FEAT_KEYMAP)
#if defined(FEAT_KEYMAP)
/* Unshown 'keymap' in status lines */
if (curbuf->b_p_iminsert == B_IMODE_LMAP)
{