Mercurial > vim
diff src/gui_w32.c @ 12477:68d7bc045dbe v8.0.1118
patch 8.0.1118: FEAT_WINDOWS adds a lot of #ifdefs
commit https://github.com/vim/vim/commit/4033c55eca575777718c0701e26635a0cc47d907
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Sep 16 20:54:51 2017 +0200
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.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 16 Sep 2017 21:00:06 +0200 |
parents | 2a8890b80923 |
children | 3ca08bf99396 |
line wrap: on
line diff
--- a/src/gui_w32.c +++ b/src/gui_w32.c @@ -2947,13 +2947,11 @@ gui_mch_show_popupmenu_at(vimmenu_T *men 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 @@ gui_mch_browse( 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 @@ gui_mch_browse( 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 @@ gui_mch_browse( 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 @@ gui_mch_set_sp_color(guicolor_T color) 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) {