summaryrefslogtreecommitdiff
path: root/src/gui_w32.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-09-16 20:54:51 +0200
committerBram Moolenaar <Bram@vim.org>2017-09-16 20:54:51 +0200
commit4033c55eca575777718c0701e26635a0cc47d907 (patch)
tree8dc460ad495106198a9119b52f6505033f7a75b3 /src/gui_w32.c
parente738a1a033cd31cd2568ba99a9e2dca1e65b45ea (diff)
downloadvim-4033c55eca575777718c0701e26635a0cc47d907.zip
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.
Diffstat (limited to 'src/gui_w32.c')
-rw-r--r--src/gui_w32.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/gui_w32.c b/src/gui_w32.c
index c4a57e675..d9ac8465e 100644
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -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)
{