From 4033c55eca575777718c0701e26635a0cc47d907 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 16 Sep 2017 20:54:51 +0200 Subject: 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. --- src/gui_w32.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'src/gui_w32.c') diff --git a/src/gui_w32.c b/src/gui_w32.c index c4a57e675a..d9ac8465ee 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) { -- cgit v1.2.3