To: vim_dev@googlegroups.com Subject: Patch 8.1.2376 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.2376 Problem: Preprocessor indents are incorrect. Solution: Fix the indents. (Ken Takata, closes #5298) Files: src/drawline.c, src/gui_w32.c src/os_mswin.c src/os_win32.c src/proto.h *** ../vim-8.1.2375/src/drawline.c 2019-11-30 22:47:42.639331256 +0100 --- src/drawline.c 2019-12-01 18:52:53.332261481 +0100 *************** *** 1940,1950 **** c_final = NUL; if (VIM_ISWHITE(c)) { ! #ifdef FEAT_CONCEAL if (c == TAB) // See "Tab alignment" below. FIX_FOR_BOGUSCOLS; ! #endif if (!wp->w_p_list) c = ' '; } --- 1940,1950 ---- c_final = NUL; if (VIM_ISWHITE(c)) { ! # ifdef FEAT_CONCEAL if (c == TAB) // See "Tab alignment" below. FIX_FOR_BOGUSCOLS; ! # endif if (!wp->w_p_list) c = ' '; } *** ../vim-8.1.2375/src/gui_w32.c 2019-11-30 22:47:42.647331219 +0100 --- src/gui_w32.c 2019-12-01 18:52:53.332261481 +0100 *************** *** 187,203 **** /* cproto fails on missing include files */ #ifndef PROTO ! #ifndef __MINGW32__ ! # include ! #endif ! #if defined(FEAT_TOOLBAR) || defined(FEAT_BEVAL_GUI) || defined(FEAT_GUI_TABLINE) ! # include ! #endif ! #include ! #ifdef GLOBAL_IME ! # include "glbl_ime.h" ! #endif #endif /* PROTO */ --- 187,203 ---- /* cproto fails on missing include files */ #ifndef PROTO ! # ifndef __MINGW32__ ! # include ! # endif ! # if defined(FEAT_TOOLBAR) || defined(FEAT_BEVAL_GUI) || defined(FEAT_GUI_TABLINE) ! # include ! # endif ! # include ! # ifdef GLOBAL_IME ! # include "glbl_ime.h" ! # endif #endif /* PROTO */ *************** *** 2106,2115 **** MSG msg; parse_queued_messages(); ! #ifdef FEAT_TIMERS if (did_add_timer) break; ! #endif if (pPeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) { process_message(); --- 2106,2115 ---- MSG msg; parse_queued_messages(); ! # ifdef FEAT_TIMERS if (did_add_timer) break; ! # endif if (pPeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) { process_message(); *************** *** 2392,2398 **** } /* The number of bitmaps is fixed. Exit is missing! */ ! #define TOOLBAR_BITMAP_COUNT 31 #endif --- 2392,2398 ---- } /* The number of bitmaps is fixed. Exit is missing! */ ! # define TOOLBAR_BITMAP_COUNT 31 #endif *************** *** 2515,2524 **** if (s_tabhwnd == NULL) return; ! #ifndef CCM_SETUNICODEFORMAT /* For older compilers. We assume this never changes. */ ! # define CCM_SETUNICODEFORMAT 0x2005 ! #endif // Enable unicode support SendMessage(s_tabhwnd, CCM_SETUNICODEFORMAT, (WPARAM)TRUE, (LPARAM)0); --- 2515,2524 ---- if (s_tabhwnd == NULL) return; ! # ifndef CCM_SETUNICODEFORMAT /* For older compilers. We assume this never changes. */ ! # define CCM_SETUNICODEFORMAT 0x2005 ! # endif // Enable unicode support SendMessage(s_tabhwnd, CCM_SETUNICODEFORMAT, (WPARAM)TRUE, (LPARAM)0); *************** *** 3502,3513 **** filterp = convert_filterW(filter); vim_memset(&fileStruct, 0, sizeof(OPENFILENAMEW)); ! # ifdef OPENFILENAME_SIZE_VERSION_400W /* be compatible with Windows NT 4.0 */ fileStruct.lStructSize = OPENFILENAME_SIZE_VERSION_400W; ! # else fileStruct.lStructSize = sizeof(fileStruct); ! # endif if (title != NULL) titlep = enc_to_utf16(title, NULL); --- 3502,3513 ---- filterp = convert_filterW(filter); vim_memset(&fileStruct, 0, sizeof(OPENFILENAMEW)); ! # ifdef OPENFILENAME_SIZE_VERSION_400W /* be compatible with Windows NT 4.0 */ fileStruct.lStructSize = OPENFILENAME_SIZE_VERSION_400W; ! # else fileStruct.lStructSize = sizeof(fileStruct); ! # endif if (title != NULL) titlep = enc_to_utf16(title, NULL); *************** *** 3544,3553 **** * Don't use OFN_OVERWRITEPROMPT, Vim has its own ":confirm" dialog. */ fileStruct.Flags = (OFN_NOCHANGEDIR | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY); ! # ifdef FEAT_SHORTCUT if (curbuf->b_p_bin) fileStruct.Flags |= OFN_NODEREFERENCELINKS; ! # endif if (saving) { if (!GetSaveFileNameW(&fileStruct)) --- 3544,3553 ---- * Don't use OFN_OVERWRITEPROMPT, Vim has its own ":confirm" dialog. */ fileStruct.Flags = (OFN_NOCHANGEDIR | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY); ! # ifdef FEAT_SHORTCUT if (curbuf->b_p_bin) fileStruct.Flags |= OFN_NODEREFERENCELINKS; ! # endif if (saving) { if (!GetSaveFileNameW(&fileStruct)) *************** *** 3915,3921 **** /* For the Intellimouse: */ #ifndef WM_MOUSEWHEEL ! #define WM_MOUSEWHEEL 0x20a #endif --- 3915,3921 ---- /* For the Intellimouse: */ #ifndef WM_MOUSEWHEEL ! # define WM_MOUSEWHEEL 0x20a #endif *************** *** 3923,3934 **** # define ID_BEVAL_TOOLTIP 200 # define BEVAL_TEXT_LEN MAXPATHL ! #if (defined(_MSC_VER) && _MSC_VER < 1300) || !defined(MAXULONG_PTR) /* Work around old versions of basetsd.h which wrongly declares * UINT_PTR as unsigned long. */ ! # undef UINT_PTR ! # define UINT_PTR UINT ! #endif static BalloonEval *cur_beval = NULL; static UINT_PTR BevalTimerId = 0; --- 3923,3934 ---- # define ID_BEVAL_TOOLTIP 200 # define BEVAL_TEXT_LEN MAXPATHL ! # if (defined(_MSC_VER) && _MSC_VER < 1300) || !defined(MAXULONG_PTR) /* Work around old versions of basetsd.h which wrongly declares * UINT_PTR as unsigned long. */ ! # undef UINT_PTR ! # define UINT_PTR UINT ! # endif static BalloonEval *cur_beval = NULL; static UINT_PTR BevalTimerId = 0; *************** *** 3936,3950 **** /* cproto fails on missing include files */ ! #ifndef PROTO /* * excerpts from headers since this may not be presented * in the extremely old compilers */ ! # include ! #endif typedef struct _DllVersionInfo { --- 3936,3950 ---- /* cproto fails on missing include files */ ! # ifndef PROTO /* * excerpts from headers since this may not be presented * in the extremely old compilers */ ! # include ! # endif typedef struct _DllVersionInfo { *************** *** 3955,3963 **** DWORD dwPlatformID; } DLLVERSIONINFO; ! #ifndef PROTO ! # include ! #endif typedef struct tagTOOLINFOA_NEW { --- 3955,3963 ---- DWORD dwPlatformID; } DLLVERSIONINFO; ! # ifndef PROTO ! # include ! # endif typedef struct tagTOOLINFOA_NEW { *************** *** 4006,4022 **** typedef HRESULT (WINAPI* DLLGETVERSIONPROC)(DLLVERSIONINFO *); ! #ifndef TTM_SETMAXTIPWIDTH ! # define TTM_SETMAXTIPWIDTH (WM_USER+24) ! #endif ! #ifndef TTF_DI_SETITEM ! # define TTF_DI_SETITEM 0x8000 ! #endif ! #ifndef TTN_GETDISPINFO ! # define TTN_GETDISPINFO (TTN_FIRST - 0) ! #endif #endif /* defined(FEAT_BEVAL_GUI) */ --- 4006,4022 ---- typedef HRESULT (WINAPI* DLLGETVERSIONPROC)(DLLVERSIONINFO *); ! # ifndef TTM_SETMAXTIPWIDTH ! # define TTM_SETMAXTIPWIDTH (WM_USER+24) ! # endif ! # ifndef TTF_DI_SETITEM ! # define TTF_DI_SETITEM 0x8000 ! # endif ! # ifndef TTN_GETDISPINFO ! # define TTN_GETDISPINFO (TTN_FIRST - 0) ! # endif #endif /* defined(FEAT_BEVAL_GUI) */ *************** *** 5570,5576 **** State &= ~LANGMAP; if (State & INSERT) { ! #if defined(FEAT_KEYMAP) /* Unshown 'keymap' in status lines */ if (curbuf->b_p_iminsert == B_IMODE_LMAP) { --- 5570,5576 ---- State &= ~LANGMAP; if (State & INSERT) { ! # if defined(FEAT_KEYMAP) /* Unshown 'keymap' in status lines */ if (curbuf->b_p_iminsert == B_IMODE_LMAP) { *************** *** 5588,5594 **** gui.row = old_row; gui.col = old_col; } ! #endif } } gui_update_cursor(TRUE, FALSE); --- 5588,5594 ---- gui.row = old_row; gui.col = old_col; } ! # endif } } gui_update_cursor(TRUE, FALSE); *************** *** 6388,6397 **** /* Fix window size if menu may have wrapped */ if (parent == NULL) gui_mswin_get_menu_height(!gui.starting); ! #ifdef FEAT_TEAROFF else if (IsWindow(parent->tearoff_handle)) rebuild_tearoff(parent); ! #endif } void --- 6388,6397 ---- /* Fix window size if menu may have wrapped */ if (parent == NULL) gui_mswin_get_menu_height(!gui.starting); ! # ifdef FEAT_TEAROFF else if (IsWindow(parent->tearoff_handle)) rebuild_tearoff(parent); ! # endif } void *************** *** 6432,6438 **** } } ! #if defined(FEAT_TEAROFF) || defined(PROTO) /* * Given a menu descriptor, e.g. "File.New", find it in the menu hierarchy and * create it as a pseudo-"tearoff menu". --- 6432,6438 ---- } } ! # if defined(FEAT_TEAROFF) || defined(PROTO) /* * Given a menu descriptor, e.g. "File.New", find it in the menu hierarchy and * create it as a pseudo-"tearoff menu". *************** *** 6446,6452 **** if (menu != NULL) gui_mch_tearoff(menu->dname, menu, 0xffffL, 0xffffL); } ! #endif /* * Add a menu item to a menu --- 6446,6452 ---- if (menu != NULL) gui_mch_tearoff(menu->dname, menu, 0xffffL, 0xffffL); } ! # endif /* * Add a menu item to a menu *************** *** 6461,6475 **** menu->id = s_menu_id++; menu->submenu_id = NULL; ! #ifdef FEAT_TEAROFF if (STRNCMP(menu->name, TEAR_STRING, TEAR_LEN) == 0) { InsertMenu(parent->submenu_id, (UINT)idx, MF_BITMAP|MF_BYPOSITION, (UINT)menu->id, (LPCTSTR) s_htearbitmap); } else ! #endif ! #ifdef FEAT_TOOLBAR if (menu_is_toolbar(parent->name)) { TBBUTTON newtb; --- 6461,6475 ---- menu->id = s_menu_id++; menu->submenu_id = NULL; ! # ifdef FEAT_TEAROFF if (STRNCMP(menu->name, TEAR_STRING, TEAR_LEN) == 0) { InsertMenu(parent->submenu_id, (UINT)idx, MF_BITMAP|MF_BYPOSITION, (UINT)menu->id, (LPCTSTR) s_htearbitmap); } else ! # endif ! # ifdef FEAT_TOOLBAR if (menu_is_toolbar(parent->name)) { TBBUTTON newtb; *************** *** 6493,6499 **** menu->submenu_id = (HMENU)-1; } else ! #endif { WCHAR *wn; --- 6493,6499 ---- menu->submenu_id = (HMENU)-1; } else ! # endif { WCHAR *wn; *************** *** 6506,6515 **** (UINT)menu->id, wn); vim_free(wn); } ! #ifdef FEAT_TEAROFF if (IsWindow(parent->tearoff_handle)) rebuild_tearoff(parent); ! #endif } } --- 6506,6515 ---- (UINT)menu->id, wn); vim_free(wn); } ! # ifdef FEAT_TEAROFF if (IsWindow(parent->tearoff_handle)) rebuild_tearoff(parent); ! # endif } } *************** *** 6519,6525 **** void gui_mch_destroy_menu(vimmenu_T *menu) { ! #ifdef FEAT_TOOLBAR /* * is this a toolbar button? */ --- 6519,6525 ---- void gui_mch_destroy_menu(vimmenu_T *menu) { ! # ifdef FEAT_TOOLBAR /* * is this a toolbar button? */ *************** *** 6532,6538 **** SendMessage(s_toolbarhwnd, TB_DELETEBUTTON, (WPARAM)iButton, 0); } else ! #endif { if (menu->parent != NULL && menu_is_popup(menu->parent->dname) --- 6532,6538 ---- SendMessage(s_toolbarhwnd, TB_DELETEBUTTON, (WPARAM)iButton, 0); } else ! # endif { if (menu->parent != NULL && menu_is_popup(menu->parent->dname) *************** *** 6542,6548 **** RemoveMenu(s_menuBar, menu->id, MF_BYCOMMAND); if (menu->submenu_id != NULL) DestroyMenu(menu->submenu_id); ! #ifdef FEAT_TEAROFF if (IsWindow(menu->tearoff_handle)) DestroyWindow(menu->tearoff_handle); if (menu->parent != NULL --- 6542,6548 ---- RemoveMenu(s_menuBar, menu->id, MF_BYCOMMAND); if (menu->submenu_id != NULL) DestroyMenu(menu->submenu_id); ! # ifdef FEAT_TEAROFF if (IsWindow(menu->tearoff_handle)) DestroyWindow(menu->tearoff_handle); if (menu->parent != NULL *************** *** 6553,6563 **** menu->modes = 0; rebuild_tearoff(menu->parent); } ! #endif } } ! #ifdef FEAT_TEAROFF static void rebuild_tearoff(vimmenu_T *menu) { --- 6553,6563 ---- menu->modes = 0; rebuild_tearoff(menu->parent); } ! # endif } } ! # ifdef FEAT_TEAROFF static void rebuild_tearoff(vimmenu_T *menu) { *************** *** 6595,6601 **** SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE); } } ! #endif /* FEAT_TEAROFF */ /* * Make a menu either grey or not grey. --- 6595,6601 ---- SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE); } } ! # endif /* FEAT_TEAROFF */ /* * Make a menu either grey or not grey. *************** *** 6605,6611 **** vimmenu_T *menu, int grey) { ! #ifdef FEAT_TOOLBAR /* * is this a toolbar button? */ --- 6605,6611 ---- vimmenu_T *menu, int grey) { ! # ifdef FEAT_TOOLBAR /* * is this a toolbar button? */ *************** *** 6615,6625 **** (WPARAM)menu->id, (LPARAM) MAKELONG((grey ? FALSE : TRUE), 0) ); } else ! #endif (void)EnableMenuItem(menu->parent ? menu->parent->submenu_id : s_menuBar, menu->id, MF_BYCOMMAND | (grey ? MF_GRAYED : MF_ENABLED)); ! #ifdef FEAT_TEAROFF if ((menu->parent != NULL) && (IsWindow(menu->parent->tearoff_handle))) { WORD menuID; --- 6615,6625 ---- (WPARAM)menu->id, (LPARAM) MAKELONG((grey ? FALSE : TRUE), 0) ); } else ! # endif (void)EnableMenuItem(menu->parent ? menu->parent->submenu_id : s_menuBar, menu->id, MF_BYCOMMAND | (grey ? MF_GRAYED : MF_ENABLED)); ! # ifdef FEAT_TEAROFF if ((menu->parent != NULL) && (IsWindow(menu->parent->tearoff_handle))) { WORD menuID; *************** *** 6637,6643 **** EnableWindow(menuHandle, !grey); } ! #endif } #endif /* FEAT_MENU */ --- 6637,6643 ---- EnableWindow(menuHandle, !grey); } ! # endif } #endif /* FEAT_MENU */ *************** *** 6792,6812 **** int vertical; int dlgPaddingX; int dlgPaddingY; ! #ifdef USE_SYSMENU_FONT LOGFONTW lfSysmenu; int use_lfSysmenu = FALSE; ! #endif garray_T ga; int l; ! #ifndef NO_CONSOLE /* Don't output anything in silent mode ("ex -s") */ ! # ifdef VIMDLL if (!(gui.in_use || gui.starting)) ! # endif if (silent_mode) return dfltbutton; /* return default option */ ! #endif if (s_hwnd == NULL) get_dialog_font_metrics(); --- 6792,6812 ---- int vertical; int dlgPaddingX; int dlgPaddingY; ! # ifdef USE_SYSMENU_FONT LOGFONTW lfSysmenu; int use_lfSysmenu = FALSE; ! # endif garray_T ga; int l; ! # ifndef NO_CONSOLE /* Don't output anything in silent mode ("ex -s") */ ! # ifdef VIMDLL if (!(gui.in_use || gui.starting)) ! # endif if (silent_mode) return dfltbutton; /* return default option */ ! # endif if (s_hwnd == NULL) get_dialog_font_metrics(); *************** *** 6858,6871 **** */ hwnd = GetDesktopWindow(); hdc = GetWindowDC(hwnd); ! #ifdef USE_SYSMENU_FONT if (gui_w32_get_menu_font(&lfSysmenu) == OK) { font = CreateFontIndirectW(&lfSysmenu); use_lfSysmenu = TRUE; } else ! #endif font = CreateFont(-DLG_FONT_POINT_SIZE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, VARIABLE_PITCH , DLG_FONT_NAME); if (s_usenewlook) --- 6858,6871 ---- */ hwnd = GetDesktopWindow(); hdc = GetWindowDC(hwnd); ! # ifdef USE_SYSMENU_FONT if (gui_w32_get_menu_font(&lfSysmenu) == OK) { font = CreateFontIndirectW(&lfSysmenu); use_lfSysmenu = TRUE; } else ! # endif font = CreateFont(-DLG_FONT_POINT_SIZE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, VARIABLE_PITCH , DLG_FONT_NAME); if (s_usenewlook) *************** *** 7084,7090 **** if (s_usenewlook) { /* do the font, since DS_3DLOOK doesn't work properly */ ! #ifdef USE_SYSMENU_FONT if (use_lfSysmenu) { /* point size */ --- 7084,7090 ---- if (s_usenewlook) { /* do the font, since DS_3DLOOK doesn't work properly */ ! # ifdef USE_SYSMENU_FONT if (use_lfSysmenu) { /* point size */ *************** *** 7094,7100 **** nchar = (int)wcslen(lfSysmenu.lfFaceName) + 1; } else ! #endif { *p++ = DLG_FONT_POINT_SIZE; // point size nchar = nCopyAnsiToWideChar(p, DLG_FONT_NAME, FALSE); --- 7094,7100 ---- nchar = (int)wcslen(lfSysmenu.lfFaceName) + 1; } else ! # endif { *p++ = DLG_FONT_POINT_SIZE; // point size nchar = nCopyAnsiToWideChar(p, DLG_FONT_NAME, FALSE); *************** *** 7530,7539 **** int sepPadding=0; int x; int y; ! #ifdef USE_SYSMENU_FONT LOGFONTW lfSysmenu; int use_lfSysmenu = FALSE; ! #endif /* * If this menu is already torn off, move it to the mouse position. --- 7530,7539 ---- int sepPadding=0; int x; int y; ! # ifdef USE_SYSMENU_FONT LOGFONTW lfSysmenu; int use_lfSysmenu = FALSE; ! # endif /* * If this menu is already torn off, move it to the mouse position. *************** *** 7564,7577 **** hwnd = GetDesktopWindow(); hdc = GetWindowDC(hwnd); ! #ifdef USE_SYSMENU_FONT if (gui_w32_get_menu_font(&lfSysmenu) == OK) { font = CreateFontIndirectW(&lfSysmenu); use_lfSysmenu = TRUE; } else ! #endif font = CreateFont(-DLG_FONT_POINT_SIZE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, VARIABLE_PITCH , DLG_FONT_NAME); if (s_usenewlook) --- 7564,7577 ---- hwnd = GetDesktopWindow(); hdc = GetWindowDC(hwnd); ! # ifdef USE_SYSMENU_FONT if (gui_w32_get_menu_font(&lfSysmenu) == OK) { font = CreateFontIndirectW(&lfSysmenu); use_lfSysmenu = TRUE; } else ! # endif font = CreateFont(-DLG_FONT_POINT_SIZE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, VARIABLE_PITCH , DLG_FONT_NAME); if (s_usenewlook) *************** *** 7670,7676 **** if (s_usenewlook) { /* do the font, since DS_3DLOOK doesn't work properly */ ! #ifdef USE_SYSMENU_FONT if (use_lfSysmenu) { /* point size */ --- 7670,7676 ---- if (s_usenewlook) { /* do the font, since DS_3DLOOK doesn't work properly */ ! # ifdef USE_SYSMENU_FONT if (use_lfSysmenu) { /* point size */ *************** *** 7680,7686 **** nchar = (int)wcslen(lfSysmenu.lfFaceName) + 1; } else ! #endif { *p++ = DLG_FONT_POINT_SIZE; // point size nchar = nCopyAnsiToWideChar(p, DLG_FONT_NAME, FALSE); --- 7680,7686 ---- nchar = (int)wcslen(lfSysmenu.lfFaceName) + 1; } else ! # endif { *p++ = DLG_FONT_POINT_SIZE; // point size nchar = nCopyAnsiToWideChar(p, DLG_FONT_NAME, FALSE); *************** *** 7832,7838 **** #endif #if defined(FEAT_TOOLBAR) || defined(PROTO) ! #include "gui_w32_rc.h" /* This not defined in older SDKs */ # ifndef TBSTYLE_FLAT --- 7832,7838 ---- #endif #if defined(FEAT_TOOLBAR) || defined(PROTO) ! # include "gui_w32_rc.h" /* This not defined in older SDKs */ # ifndef TBSTYLE_FLAT *************** *** 7918,7926 **** */ if (hbitmap == NULL && (gui_find_bitmap( ! #ifdef FEAT_MULTI_LANG menu->en_dname != NULL ? menu->en_dname : ! #endif menu->dname, fname, "bmp") == OK)) hbitmap = LoadImage( NULL, --- 7918,7926 ---- */ if (hbitmap == NULL && (gui_find_bitmap( ! # ifdef FEAT_MULTI_LANG menu->en_dname != NULL ? menu->en_dname : ! # endif menu->dname, fname, "bmp") == OK)) hbitmap = LoadImage( NULL, *************** *** 8156,8164 **** { HANDLE hImage; UINT uType; ! #ifdef FEAT_XPM_W32 HANDLE hShape; /* Mask bitmap handle */ ! #endif } signicon_t; void --- 8156,8164 ---- { HANDLE hImage; UINT uType; ! # ifdef FEAT_XPM_W32 HANDLE hShape; /* Mask bitmap handle */ ! # endif } signicon_t; void *************** *** 8170,8179 **** if (!gui.in_use || (sign = (signicon_t *)sign_get_image(typenr)) == NULL) return; ! #if defined(FEAT_DIRECTX) if (IS_ENABLE_DIRECTX()) DWriteContext_Flush(s_dwc); ! #endif x = TEXT_X(col); y = TEXT_Y(row); --- 8170,8179 ---- if (!gui.in_use || (sign = (signicon_t *)sign_get_image(typenr)) == NULL) return; ! # if defined(FEAT_DIRECTX) if (IS_ENABLE_DIRECTX()) DWriteContext_Flush(s_dwc); ! # endif x = TEXT_X(col); y = TEXT_Y(row); *************** *** 8197,8203 **** case IMAGE_CURSOR: DrawIconEx(s_hdc, x, y, (HICON)sign->hImage, w, h, 0, NULL, DI_NORMAL); break; ! #ifdef FEAT_XPM_W32 case IMAGE_XPM: { HDC hdcMem; --- 8197,8203 ---- case IMAGE_CURSOR: DrawIconEx(s_hdc, x, y, (HICON)sign->hImage, w, h, 0, NULL, DI_NORMAL); break; ! # ifdef FEAT_XPM_W32 case IMAGE_XPM: { HDC hdcMem; *************** *** 8215,8221 **** DeleteDC(hdcMem); } break; ! #endif } } --- 8215,8221 ---- DeleteDC(hdcMem); } break; ! # endif } } *************** *** 8234,8245 **** case IMAGE_ICON: DestroyIcon((HICON)sign->hImage); break; ! #ifdef FEAT_XPM_W32 case IMAGE_XPM: DeleteObject((HBITMAP)sign->hImage); DeleteObject((HBITMAP)sign->hShape); break; ! #endif } } --- 8234,8245 ---- case IMAGE_ICON: DestroyIcon((HICON)sign->hImage); break; ! # ifdef FEAT_XPM_W32 case IMAGE_XPM: DeleteObject((HBITMAP)sign->hImage); DeleteObject((HBITMAP)sign->hShape); break; ! # endif } } *************** *** 8268,8281 **** sign.hImage = (HANDLE)LoadImage(NULL, (LPCSTR)signfile, sign.uType, gui.char_width * 2, gui.char_height, LR_LOADFROMFILE | LR_CREATEDIBSECTION); ! #ifdef FEAT_XPM_W32 if (!STRICMP(ext, ".xpm")) { sign.uType = IMAGE_XPM; LoadXpmImage((char *)signfile, (HBITMAP *)&sign.hImage, (HBITMAP *)&sign.hShape); } ! #endif } psign = NULL; --- 8268,8281 ---- sign.hImage = (HANDLE)LoadImage(NULL, (LPCSTR)signfile, sign.uType, gui.char_width * 2, gui.char_height, LR_LOADFROMFILE | LR_CREATEDIBSECTION); ! # ifdef FEAT_XPM_W32 if (!STRICMP(ext, ".xpm")) { sign.uType = IMAGE_XPM; LoadXpmImage((char *)signfile, (HBITMAP *)&sign.hImage, (HBITMAP *)&sign.hShape); } ! # endif } psign = NULL; *************** *** 8650,8658 **** void gui_mch_destroy_beval_area(BalloonEval *beval) { ! #ifdef FEAT_VARTABS vim_free(beval->vts); ! #endif vim_free(beval->tofree); vim_free(beval); } --- 8650,8658 ---- void gui_mch_destroy_beval_area(BalloonEval *beval) { ! # ifdef FEAT_VARTABS vim_free(beval->vts); ! # endif vim_free(beval->tofree); vim_free(beval); } *************** *** 8676,8685 **** x = 0; y = TEXT_Y(row); ! #if defined(FEAT_DIRECTX) if (IS_ENABLE_DIRECTX()) DWriteContext_Flush(s_dwc); ! #endif for (i = 0; i < gui.char_height - 3; i++) SetPixel(s_hdc, x+2, y++, gui.currFgColor); --- 8676,8685 ---- x = 0; y = TEXT_Y(row); ! # if defined(FEAT_DIRECTX) if (IS_ENABLE_DIRECTX()) DWriteContext_Flush(s_dwc); ! # endif for (i = 0; i < gui.char_height - 3; i++) SetPixel(s_hdc, x+2, y++, gui.currFgColor); *** ../vim-8.1.2375/src/os_mswin.c 2019-10-06 22:00:08.297244105 +0200 --- src/os_mswin.c 2019-12-01 18:52:53.332261481 +0100 *************** *** 77,84 **** * errors disappear. They do not need to be correct. */ #ifdef PROTO ! #define WINAPI ! #define WINBASEAPI typedef int BOOL; typedef int CALLBACK; typedef int COLORREF; --- 77,84 ---- * errors disappear. They do not need to be correct. */ #ifdef PROTO ! # define WINAPI ! # define WINBASEAPI typedef int BOOL; typedef int CALLBACK; typedef int COLORREF; *************** *** 211,226 **** WSACleanup(); } # endif ! #ifdef DYNAMIC_GETTEXT dyn_libintl_end(); ! #endif if (gui.in_use) gui_exit(r); ! #ifdef EXITFREE free_all_mem(); ! #endif exit(r); } --- 211,226 ---- WSACleanup(); } # endif ! # ifdef DYNAMIC_GETTEXT dyn_libintl_end(); ! # endif if (gui.in_use) gui_exit(r); ! # ifdef EXITFREE free_all_mem(); ! # endif exit(r); } *************** *** 309,320 **** void mch_restore_title(int which UNUSED) { ! #if !defined(FEAT_GUI_MSWIN) || defined(VIMDLL) ! # ifdef VIMDLL if (!gui.in_use) ! # endif SetConsoleTitle(g_szOrigTitle); ! #endif } --- 309,320 ---- void mch_restore_title(int which UNUSED) { ! # if !defined(FEAT_GUI_MSWIN) || defined(VIMDLL) ! # ifdef VIMDLL if (!gui.in_use) ! # endif SetConsoleTitle(g_szOrigTitle); ! # endif } *************** *** 663,673 **** for ( ; *p; MB_PTR_ADV(p)) { if (vim_strchr((char_u *) ! # ifdef VIM_BACKTICK "?*$[`" ! # else "?*$[" ! # endif , *p) != NULL || (*p == '~' && p[1] != NUL)) return TRUE; --- 663,673 ---- for ( ; *p; MB_PTR_ADV(p)) { if (vim_strchr((char_u *) ! #ifdef VIM_BACKTICK "?*$[`" ! #else "?*$[" ! #endif , *p) != NULL || (*p == '~' && p[1] != NUL)) return TRUE; *************** *** 854,863 **** // If the handle is valid, try to get the function address. if (hinstLib != NULL) { ! #ifdef HAVE_TRY_EXCEPT __try { ! #endif if (argstring != NULL) { /* Call with string argument */ --- 854,863 ---- // If the handle is valid, try to get the function address. if (hinstLib != NULL) { ! # ifdef HAVE_TRY_EXCEPT __try { ! # endif if (argstring != NULL) { /* Call with string argument */ *************** *** 895,901 **** mch_memmove(*string_result, retval_str, len); } ! #ifdef HAVE_TRY_EXCEPT } __except(EXCEPTION_EXECUTE_HANDLER) { --- 895,901 ---- mch_memmove(*string_result, retval_str, len); } ! # ifdef HAVE_TRY_EXCEPT } __except(EXCEPTION_EXECUTE_HANDLER) { *************** *** 903,909 **** RESETSTKOFLW(); fRunTimeLinkSuccess = 0; } ! #endif // Free the DLL module. (void)FreeLibrary(hinstLib); --- 903,909 ---- RESETSTKOFLW(); fRunTimeLinkSuccess = 0; } ! # endif // Free the DLL module. (void)FreeLibrary(hinstLib); *************** *** 925,931 **** void DumpPutS(const char *psz UNUSED) { ! # ifdef MCH_WRITE_DUMP if (fdDump) { fputs(psz, fdDump); --- 925,931 ---- void DumpPutS(const char *psz UNUSED) { ! #ifdef MCH_WRITE_DUMP if (fdDump) { fputs(psz, fdDump); *************** *** 933,939 **** fputc('\n', fdDump); fflush(fdDump); } ! # endif } #ifdef _DEBUG --- 933,939 ---- fputc('\n', fdDump); fflush(fdDump); } ! #endif } #ifdef _DEBUG *************** *** 1032,1041 **** static char_u *prt_name = NULL; /* Defines which are also in vim.rc. */ ! #define IDC_BOX1 400 ! #define IDC_PRINTTEXT1 401 ! #define IDC_PRINTTEXT2 402 ! #define IDC_PROGRESS 403 static BOOL vimSetDlgItemText(HWND hDlg, int nIDDlgItem, char_u *s) --- 1032,1041 ---- static char_u *prt_name = NULL; /* Defines which are also in vim.rc. */ ! # define IDC_BOX1 400 ! # define IDC_PRINTTEXT1 401 ! # define IDC_PRINTTEXT2 402 ! # define IDC_PROGRESS 403 static BOOL vimSetDlgItemText(HWND hDlg, int nIDDlgItem, char_u *s) *************** *** 1068,1078 **** } /* Attempt to make this work for old and new compilers */ ! #if !defined(_WIN64) && (!defined(_MSC_VER) || _MSC_VER < 1300) ! # define PDP_RETVAL BOOL ! #else ! # define PDP_RETVAL INT_PTR ! #endif static PDP_RETVAL CALLBACK PrintDlgProc( --- 1068,1078 ---- } /* Attempt to make this work for old and new compilers */ ! # if !defined(_WIN64) && (!defined(_MSC_VER) || _MSC_VER < 1300) ! # define PDP_RETVAL BOOL ! # else ! # define PDP_RETVAL INT_PTR ! # endif static PDP_RETVAL CALLBACK PrintDlgProc( *************** *** 1081,1095 **** WPARAM wParam UNUSED, LPARAM lParam UNUSED) { ! #ifdef FEAT_GETTEXT NONCLIENTMETRICS nm; static HFONT hfont; ! #endif switch (message) { case WM_INITDIALOG: ! #ifdef FEAT_GETTEXT nm.cbSize = sizeof(NONCLIENTMETRICS); if (SystemParametersInfo( SPI_GETNONCLIENTMETRICS, --- 1081,1095 ---- WPARAM wParam UNUSED, LPARAM lParam UNUSED) { ! # ifdef FEAT_GETTEXT NONCLIENTMETRICS nm; static HFONT hfont; ! # endif switch (message) { case WM_INITDIALOG: ! # ifdef FEAT_GETTEXT nm.cbSize = sizeof(NONCLIENTMETRICS); if (SystemParametersInfo( SPI_GETNONCLIENTMETRICS, *************** *** 1113,1119 **** if (GetDlgItemText(hDlg,IDCANCEL, buff, sizeof(buff))) vimSetDlgItemText(hDlg,IDCANCEL, (char_u *)_(buff)); } ! #endif SetWindowText(hDlg, (LPCSTR)szAppName); if (prt_name != NULL) { --- 1113,1119 ---- if (GetDlgItemText(hDlg,IDCANCEL, buff, sizeof(buff))) vimSetDlgItemText(hDlg,IDCANCEL, (char_u *)_(buff)); } ! # endif SetWindowText(hDlg, (LPCSTR)szAppName); if (prt_name != NULL) { *************** *** 1121,1132 **** VIM_CLEAR(prt_name); } EnableMenuItem(GetSystemMenu(hDlg, FALSE), SC_CLOSE, MF_GRAYED); ! #if !defined(FEAT_GUI) || defined(VIMDLL) ! # ifdef VIMDLL if (!gui.in_use) ! # endif BringWindowToTop(s_hwnd); ! #endif return TRUE; case WM_COMMAND: --- 1121,1132 ---- VIM_CLEAR(prt_name); } EnableMenuItem(GetSystemMenu(hDlg, FALSE), SC_CLOSE, MF_GRAYED); ! # if !defined(FEAT_GUI) || defined(VIMDLL) ! # ifdef VIMDLL if (!gui.in_use) ! # endif BringWindowToTop(s_hwnd); ! # endif return TRUE; case WM_COMMAND: *************** *** 1134,1142 **** EnableWindow(GetParent(hDlg), TRUE); DestroyWindow(hDlg); hDlgPrint = NULL; ! #ifdef FEAT_GETTEXT DeleteObject(hfont); ! #endif return TRUE; } return FALSE; --- 1134,1142 ---- EnableWindow(GetParent(hDlg), TRUE); DestroyWindow(hDlg); hDlgPrint = NULL; ! # ifdef FEAT_GETTEXT DeleteObject(hfont); ! # endif return TRUE; } return FALSE; *************** *** 1158,1164 **** return !*bUserAbort; } ! #if !defined(FEAT_GUI) || defined(VIMDLL) static UINT_PTR CALLBACK PrintHookProc( --- 1158,1164 ---- return !*bUserAbort; } ! # if !defined(FEAT_GUI) || defined(VIMDLL) static UINT_PTR CALLBACK PrintHookProc( *************** *** 1212,1218 **** return FALSE; } ! #endif void mch_print_cleanup(void) --- 1212,1218 ---- return FALSE; } ! # endif void mch_print_cleanup(void) *************** *** 1352,1363 **** bUserAbort = &(psettings->user_abort); vim_memset(&prt_dlg, 0, sizeof(PRINTDLGW)); prt_dlg.lStructSize = sizeof(PRINTDLGW); ! #if !defined(FEAT_GUI) || defined(VIMDLL) ! # ifdef VIMDLL if (!gui.in_use) ! # endif GetConsoleHwnd(); /* get value of s_hwnd */ ! #endif prt_dlg.hwndOwner = s_hwnd; prt_dlg.Flags = PD_NOPAGENUMS | PD_NOSELECTION | PD_RETURNDC; if (!forceit) --- 1352,1363 ---- bUserAbort = &(psettings->user_abort); vim_memset(&prt_dlg, 0, sizeof(PRINTDLGW)); prt_dlg.lStructSize = sizeof(PRINTDLGW); ! # if !defined(FEAT_GUI) || defined(VIMDLL) ! # ifdef VIMDLL if (!gui.in_use) ! # endif GetConsoleHwnd(); /* get value of s_hwnd */ ! # endif prt_dlg.hwndOwner = s_hwnd; prt_dlg.Flags = PD_NOPAGENUMS | PD_NOSELECTION | PD_RETURNDC; if (!forceit) *************** *** 1365,1374 **** prt_dlg.hDevMode = stored_dm; prt_dlg.hDevNames = stored_devn; prt_dlg.lCustData = stored_nCopies; // work around bug in print dialog ! #if !defined(FEAT_GUI) || defined(VIMDLL) ! # ifdef VIMDLL if (!gui.in_use) ! # endif { /* * Use hook to prevent console window being sent to back --- 1365,1374 ---- prt_dlg.hDevMode = stored_dm; prt_dlg.hDevNames = stored_devn; prt_dlg.lCustData = stored_nCopies; // work around bug in print dialog ! # if !defined(FEAT_GUI) || defined(VIMDLL) ! # ifdef VIMDLL if (!gui.in_use) ! # endif { /* * Use hook to prevent console window being sent to back *************** *** 1376,1382 **** prt_dlg.lpfnPrintHook = PrintHookProc; prt_dlg.Flags |= PD_ENABLEPRINTHOOK; } ! #endif prt_dlg.Flags |= stored_nFlags; } --- 1376,1382 ---- prt_dlg.lpfnPrintHook = PrintHookProc; prt_dlg.Flags |= PD_ENABLEPRINTHOOK; } ! # endif prt_dlg.Flags |= stored_nFlags; } *************** *** 1385,1397 **** * never show dialog if we are running over telnet */ if (forceit ! #if !defined(FEAT_GUI) || defined(VIMDLL) ! # ifdef VIMDLL || (!gui.in_use && !term_console) ! # else || !term_console # endif - #endif ) { prt_dlg.Flags |= PD_RETURNDEFAULT; --- 1385,1397 ---- * never show dialog if we are running over telnet */ if (forceit ! # if !defined(FEAT_GUI) || defined(VIMDLL) ! # ifdef VIMDLL || (!gui.in_use && !term_console) ! # else || !term_console + # endif # endif ) { prt_dlg.Flags |= PD_RETURNDEFAULT; *************** *** 1581,1593 **** vim_free(wp); } ! #ifdef FEAT_GUI /* Give focus back to main window (when using MDI). */ ! # ifdef VIMDLL if (gui.in_use) ! # endif SetFocus(s_hwnd); ! #endif return (ret > 0); } --- 1581,1593 ---- vim_free(wp); } ! # ifdef FEAT_GUI /* Give focus back to main window (when using MDI). */ ! # ifdef VIMDLL if (gui.in_use) ! # endif SetFocus(s_hwnd); ! # endif return (ret > 0); } *************** *** 1929,1945 **** */ HWND message_window = 0; /* window that's handling messages */ ! #define VIM_CLASSNAME "VIM_MESSAGES" ! #define VIM_CLASSNAME_LEN (sizeof(VIM_CLASSNAME) - 1) /* Communication is via WM_COPYDATA messages. The message type is send in * the dwData parameter. Types are defined here. */ ! #define COPYDATA_KEYS 0 ! #define COPYDATA_REPLY 1 ! #define COPYDATA_EXPR 10 ! #define COPYDATA_RESULT 11 ! #define COPYDATA_ERROR_RESULT 12 ! #define COPYDATA_ENCODING 20 /* This is a structure containing a server HWND and its name. */ struct server_id --- 1929,1945 ---- */ HWND message_window = 0; /* window that's handling messages */ ! # define VIM_CLASSNAME "VIM_MESSAGES" ! # define VIM_CLASSNAME_LEN (sizeof(VIM_CLASSNAME) - 1) /* Communication is via WM_COPYDATA messages. The message type is send in * the dwData parameter. Types are defined here. */ ! # define COPYDATA_KEYS 0 ! # define COPYDATA_REPLY 1 ! # define COPYDATA_EXPR 10 ! # define COPYDATA_RESULT 11 ! # define COPYDATA_ERROR_RESULT 12 ! # define COPYDATA_ENCODING 20 /* This is a structure containing a server HWND and its name. */ struct server_id *************** *** 2116,2127 **** { /* When the message window is activated (brought to the foreground), * this actually applies to the text window. */ ! #if !defined(FEAT_GUI) || defined(VIMDLL) ! # ifdef VIMDLL if (!gui.in_use) ! # endif GetConsoleHwnd(); /* get value of s_hwnd */ ! #endif if (s_hwnd != 0) { SetForegroundWindow(s_hwnd); --- 2116,2127 ---- { /* When the message window is activated (brought to the foreground), * this actually applies to the text window. */ ! # if !defined(FEAT_GUI) || defined(VIMDLL) ! # ifdef VIMDLL if (!gui.in_use) ! # endif GetConsoleHwnd(); /* get value of s_hwnd */ ! # endif if (s_hwnd != 0) { SetForegroundWindow(s_hwnd); *************** *** 2323,2339 **** { /* Remember the name */ serverName = ok_name; ! #ifdef FEAT_TITLE need_maketitle = TRUE; /* update Vim window title later */ ! #endif /* Update the message window title */ SetWindowText(message_window, (LPCSTR)ok_name); ! #ifdef FEAT_EVAL /* Set the servername variable */ set_vim_var_string(VV_SEND_SERVER, serverName, -1); ! #endif } } --- 2323,2339 ---- { /* Remember the name */ serverName = ok_name; ! # ifdef FEAT_TITLE need_maketitle = TRUE; /* update Vim window title later */ ! # endif /* Update the message window title */ SetWindowText(message_window, (LPCSTR)ok_name); ! # ifdef FEAT_EVAL /* Set the servername variable */ set_vim_var_string(VV_SEND_SERVER, serverName, -1); ! # endif } } *************** *** 2473,2480 **** static garray_T reply_list = {0, 0, sizeof(reply_T), 5, 0}; ! #define REPLY_ITEM(i) ((reply_T *)(reply_list.ga_data) + (i)) ! #define REPLY_COUNT (reply_list.ga_len) /* Flag which is used to wait for a reply */ static int reply_received = 0; --- 2473,2480 ---- static garray_T reply_list = {0, 0, sizeof(reply_T), 5, 0}; ! # define REPLY_ITEM(i) ((reply_T *)(reply_list.ga_data) + (i)) ! # define REPLY_COUNT (reply_list.ga_len) /* Flag which is used to wait for a reply */ static int reply_received = 0; *************** *** 2574,2583 **** /* Loop until we receive a reply */ while (reply_received == 0) { ! #ifdef FEAT_TIMERS /* TODO: use the return value to decide how long to wait. */ check_due_timer(); ! #endif time(&now); if (timeout > 0 && (now - start) >= timeout) break; --- 2574,2583 ---- /* Loop until we receive a reply */ while (reply_received == 0) { ! # ifdef FEAT_TIMERS /* TODO: use the return value to decide how long to wait. */ check_due_timer(); ! # endif time(&now); if (timeout > 0 && (now - start) >= timeout) break; *************** *** 2645,2653 **** {"RUSSIAN", RUSSIAN_CHARSET}, {"THAI", THAI_CHARSET}, {"TURKISH", TURKISH_CHARSET}, ! #ifdef VIETNAMESE_CHARSET {"VIETNAMESE", VIETNAMESE_CHARSET}, ! #endif {NULL, 0} }; --- 2645,2653 ---- {"RUSSIAN", RUSSIAN_CHARSET}, {"THAI", THAI_CHARSET}, {"TURKISH", TURKISH_CHARSET}, ! # ifdef VIETNAMESE_CHARSET {"VIETNAMESE", VIETNAMESE_CHARSET}, ! # endif {NULL, 0} }; *************** *** 2659,2679 **** static struct quality_pair quality_pairs[] = { ! #ifdef CLEARTYPE_QUALITY {"CLEARTYPE", CLEARTYPE_QUALITY}, ! #endif ! #ifdef ANTIALIASED_QUALITY {"ANTIALIASED", ANTIALIASED_QUALITY}, ! #endif ! #ifdef NONANTIALIASED_QUALITY {"NONANTIALIASED", NONANTIALIASED_QUALITY}, ! #endif ! #ifdef PROOF_QUALITY {"PROOF", PROOF_QUALITY}, ! #endif ! #ifdef DRAFT_QUALITY {"DRAFT", DRAFT_QUALITY}, ! #endif {"DEFAULT", DEFAULT_QUALITY}, {NULL, 0} }; --- 2659,2679 ---- static struct quality_pair quality_pairs[] = { ! # ifdef CLEARTYPE_QUALITY {"CLEARTYPE", CLEARTYPE_QUALITY}, ! # endif ! # ifdef ANTIALIASED_QUALITY {"ANTIALIASED", ANTIALIASED_QUALITY}, ! # endif ! # ifdef NONANTIALIASED_QUALITY {"NONANTIALIASED", NONANTIALIASED_QUALITY}, ! # endif ! # ifdef PROOF_QUALITY {"PROOF", PROOF_QUALITY}, ! # endif ! # ifdef DRAFT_QUALITY {"DRAFT", DRAFT_QUALITY}, ! # endif {"DEFAULT", DEFAULT_QUALITY}, {NULL, 0} }; *************** *** 2799,2809 **** LOGFONTW *lf = (LOGFONTW *)(lparam); ! #ifndef FEAT_PROPORTIONAL_FONTS /* Ignore non-monospace fonts without further ado */ if ((ntm->tmPitchAndFamily & 1) != 0) return 1; ! #endif /* Remember this LOGFONTW as a "possible" */ *lf = elf->elfLogFont; --- 2799,2809 ---- LOGFONTW *lf = (LOGFONTW *)(lparam); ! # ifndef FEAT_PROPORTIONAL_FONTS /* Ignore non-monospace fonts without further ado */ if ((ntm->tmPitchAndFamily & 1) != 0) return 1; ! # endif /* Remember this LOGFONTW as a "possible" */ *lf = elf->elfLogFont; *************** *** 2895,2901 **** if (wcscmp(wname, L"*") == 0) { ! #if defined(FEAT_GUI_MSWIN) CHOOSEFONTW cf; /* if name is "*", bring up std font dialog: */ vim_memset(&cf, 0, sizeof(cf)); --- 2895,2901 ---- if (wcscmp(wname, L"*") == 0) { ! # if defined(FEAT_GUI_MSWIN) CHOOSEFONTW cf; /* if name is "*", bring up std font dialog: */ vim_memset(&cf, 0, sizeof(cf)); *************** *** 2908,2914 **** cf.nFontType = 0 ; //REGULAR_FONTTYPE; if (ChooseFontW(&cf)) ret = OK; ! #endif goto theend; } --- 2908,2914 ---- cf.nFontType = 0 ; //REGULAR_FONTTYPE; if (ChooseFontW(&cf)) ret = OK; ! # endif goto theend; } *** ../vim-8.1.2375/src/os_win32.c 2019-11-19 23:01:24.643827472 +0100 --- src/os_win32.c 2019-12-01 18:52:53.336261462 +0100 *************** *** 94,100 **** * errors disappear. They do not need to be correct. */ #ifdef PROTO ! #define WINAPI typedef char * LPCSTR; typedef char * LPWSTR; typedef int ACCESS_MASK; --- 94,100 ---- * errors disappear. They do not need to be correct. */ #ifdef PROTO ! # define WINAPI typedef char * LPCSTR; typedef char * LPWSTR; typedef int ACCESS_MASK; *************** *** 257,263 **** * Get version number including build number */ typedef BOOL (WINAPI *PfnRtlGetVersion)(LPOSVERSIONINFOW); ! # define MAKE_VER(major, minor, build) \ (((major) << 24) | ((minor) << 16) | (build)) static DWORD --- 257,263 ---- * Get version number including build number */ typedef BOOL (WINAPI *PfnRtlGetVersion)(LPOSVERSIONINFOW); ! #define MAKE_VER(major, minor, build) \ (((major) << 24) | ((minor) << 16) | (build)) static DWORD *************** *** 641,654 **** return 1; // Load gettext library (libintl.dll and other names). hLibintlDLL = vimLoadLib(GETTEXT_DLL); ! #ifdef GETTEXT_DLL_ALT1 if (!hLibintlDLL) hLibintlDLL = vimLoadLib(GETTEXT_DLL_ALT1); ! #endif ! #ifdef GETTEXT_DLL_ALT2 if (!hLibintlDLL) hLibintlDLL = vimLoadLib(GETTEXT_DLL_ALT2); ! #endif if (!hLibintlDLL) { if (p_verbose > 0) --- 641,654 ---- return 1; // Load gettext library (libintl.dll and other names). hLibintlDLL = vimLoadLib(GETTEXT_DLL); ! # ifdef GETTEXT_DLL_ALT1 if (!hLibintlDLL) hLibintlDLL = vimLoadLib(GETTEXT_DLL_ALT1); ! # endif ! # ifdef GETTEXT_DLL_ALT2 if (!hLibintlDLL) hLibintlDLL = vimLoadLib(GETTEXT_DLL_ALT2); ! # endif if (!hLibintlDLL) { if (p_verbose > 0) *************** *** 837,846 **** #if !defined(FEAT_GUI_MSWIN) || defined(VIMDLL) ! #define SHIFT (SHIFT_PRESSED) ! #define CTRL (RIGHT_CTRL_PRESSED | LEFT_CTRL_PRESSED) ! #define ALT (RIGHT_ALT_PRESSED | LEFT_ALT_PRESSED) ! #define ALT_GR (RIGHT_ALT_PRESSED | LEFT_CTRL_PRESSED) /* When uChar.AsciiChar is 0, then we need to look at wVirtualKeyCode. --- 837,846 ---- #if !defined(FEAT_GUI_MSWIN) || defined(VIMDLL) ! # define SHIFT (SHIFT_PRESSED) ! # define CTRL (RIGHT_CTRL_PRESSED | LEFT_CTRL_PRESSED) ! # define ALT (RIGHT_ALT_PRESSED | LEFT_ALT_PRESSED) ! # define ALT_GR (RIGHT_ALT_PRESSED | LEFT_CTRL_PRESSED) /* When uChar.AsciiChar is 0, then we need to look at wVirtualKeyCode. *************** *** 891,897 **** { VK_SNAPSHOT,TRUE, 0, 0, 0, 'r', }, // PrtScrn ! #if 0 // Most people don't have F13-F20, but what the hell... { VK_F13, TRUE, '\332', '\333', '\334', '\335', }, { VK_F14, TRUE, '\336', '\337', '\340', '\341', }, --- 891,897 ---- { VK_SNAPSHOT,TRUE, 0, 0, 0, 'r', }, // PrtScrn ! # if 0 // Most people don't have F13-F20, but what the hell... { VK_F13, TRUE, '\332', '\333', '\334', '\335', }, { VK_F14, TRUE, '\336', '\337', '\340', '\341', }, *************** *** 901,907 **** { VK_F18, TRUE, '\356', '\357', '\360', '\361', }, { VK_F19, TRUE, '\362', '\363', '\364', '\365', }, { VK_F20, TRUE, '\366', '\367', '\370', '\371', }, ! #endif { VK_ADD, TRUE, 'N', 'N', 'N', 'N', }, // keyp '+' { VK_SUBTRACT, TRUE,'J', 'J', 'J', 'J', }, // keyp '-' // { VK_DIVIDE, TRUE,'N', 'N', 'N', 'N', }, // keyp '/' --- 901,907 ---- { VK_F18, TRUE, '\356', '\357', '\360', '\361', }, { VK_F19, TRUE, '\362', '\363', '\364', '\365', }, { VK_F20, TRUE, '\366', '\367', '\370', '\371', }, ! # endif { VK_ADD, TRUE, 'N', 'N', 'N', 'N', }, // keyp '+' { VK_SUBTRACT, TRUE,'J', 'J', 'J', 'J', }, // keyp '-' // { VK_DIVIDE, TRUE,'N', 'N', 'N', 'N', }, // keyp '/' *************** *** 921,931 **** }; ! #if defined(__GNUC__) && !defined(__MINGW32__) && !defined(__CYGWIN__) ! # define UChar UnicodeChar ! #else ! # define UChar uChar.UnicodeChar ! #endif /* The return code indicates key code size. */ static int --- 921,931 ---- }; ! # if defined(__GNUC__) && !defined(__MINGW32__) && !defined(__CYGWIN__) ! # define UChar UnicodeChar ! # else ! # define UChar uChar.UnicodeChar ! # endif /* The return code indicates key code size. */ static int *************** *** 1489,1497 **** INPUT_RECORD ir; DWORD cRecords; WCHAR ch, ch2; ! #ifdef FEAT_TIMERS int tb_change_cnt = typebuf.tb_change_cnt; ! #endif if (msec > 0) /* Wait until the specified time has elapsed. */ --- 1489,1497 ---- INPUT_RECORD ir; DWORD cRecords; WCHAR ch, ch2; ! # ifdef FEAT_TIMERS int tb_change_cnt = typebuf.tb_change_cnt; ! # endif if (msec > 0) /* Wait until the specified time has elapsed. */ *************** *** 1507,1527 **** // Only process messages when waiting. if (msec != 0) { ! #ifdef MESSAGE_QUEUE parse_queued_messages(); ! #endif ! #ifdef FEAT_MZSCHEME mzvim_check_threads(); ! #endif ! #ifdef FEAT_CLIENTSERVER serverProcessPendingMessages(); ! #endif } if (g_nMouseClick != -1 ! #ifdef FEAT_CLIENTSERVER || (!ignore_input && input_available()) ! #endif ) return TRUE; --- 1507,1527 ---- // Only process messages when waiting. if (msec != 0) { ! # ifdef MESSAGE_QUEUE parse_queued_messages(); ! # endif ! # ifdef FEAT_MZSCHEME mzvim_check_threads(); ! # endif ! # ifdef FEAT_CLIENTSERVER serverProcessPendingMessages(); ! # endif } if (g_nMouseClick != -1 ! # ifdef FEAT_CLIENTSERVER || (!ignore_input && input_available()) ! # endif ) return TRUE; *************** *** 1537,1543 **** { DWORD dwWaitTime = dwEndTime - dwNow; ! #ifdef FEAT_JOB_CHANNEL /* Check channel while waiting for input. */ if (dwWaitTime > 100) { --- 1537,1543 ---- { DWORD dwWaitTime = dwEndTime - dwNow; ! # ifdef FEAT_JOB_CHANNEL /* Check channel while waiting for input. */ if (dwWaitTime > 100) { *************** *** 1547,1565 **** if (channel_any_readahead()) dwWaitTime = 10; } ! #endif ! #ifdef FEAT_BEVAL_GUI if (p_beval && dwWaitTime > 100) /* The 'balloonexpr' may indirectly invoke a callback while * waiting for a character, need to check often. */ dwWaitTime = 100; ! #endif ! #ifdef FEAT_MZSCHEME if (mzthreads_allowed() && p_mzq > 0 && (msec < 0 || (long)dwWaitTime > p_mzq)) dwWaitTime = p_mzq; /* don't wait longer than 'mzquantum' */ ! #endif ! #ifdef FEAT_TIMERS // When waiting very briefly don't trigger timers. if (dwWaitTime > 10) { --- 1547,1565 ---- if (channel_any_readahead()) dwWaitTime = 10; } ! # endif ! # ifdef FEAT_BEVAL_GUI if (p_beval && dwWaitTime > 100) /* The 'balloonexpr' may indirectly invoke a callback while * waiting for a character, need to check often. */ dwWaitTime = 100; ! # endif ! # ifdef FEAT_MZSCHEME if (mzthreads_allowed() && p_mzq > 0 && (msec < 0 || (long)dwWaitTime > p_mzq)) dwWaitTime = p_mzq; /* don't wait longer than 'mzquantum' */ ! # endif ! # ifdef FEAT_TIMERS // When waiting very briefly don't trigger timers. if (dwWaitTime > 10) { *************** *** 1576,1592 **** if (due_time > 0 && dwWaitTime > (DWORD)due_time) dwWaitTime = due_time; } ! #endif if ( ! #ifdef FEAT_CLIENTSERVER // Wait for either an event on the console input or a // message in the client-server window. msg_wait_for_multiple_objects(1, &g_hConIn, FALSE, dwWaitTime, QS_SENDMESSAGE) != WAIT_OBJECT_0 ! #else wait_for_single_object(g_hConIn, dwWaitTime) != WAIT_OBJECT_0 ! #endif ) continue; } --- 1576,1592 ---- if (due_time > 0 && dwWaitTime > (DWORD)due_time) dwWaitTime = due_time; } ! # endif if ( ! # ifdef FEAT_CLIENTSERVER // Wait for either an event on the console input or a // message in the client-server window. msg_wait_for_multiple_objects(1, &g_hConIn, FALSE, dwWaitTime, QS_SENDMESSAGE) != WAIT_OBJECT_0 ! # else wait_for_single_object(g_hConIn, dwWaitTime) != WAIT_OBJECT_0 ! # endif ) continue; } *************** *** 1594,1600 **** cRecords = 0; peek_console_input(g_hConIn, &ir, 1, &cRecords); ! #ifdef FEAT_MBYTE_IME if (State & CMDLINE && msg_row == Rows - 1) { CONSOLE_SCREEN_BUFFER_INFO csbi; --- 1594,1600 ---- cRecords = 0; peek_console_input(g_hConIn, &ir, 1, &cRecords); ! # ifdef FEAT_MBYTE_IME if (State & CMDLINE && msg_row == Rows - 1) { CONSOLE_SCREEN_BUFFER_INFO csbi; *************** *** 1611,1623 **** } } } ! #endif if (cRecords > 0) { if (ir.EventType == KEY_EVENT && ir.Event.KeyEvent.bKeyDown) { ! #ifdef FEAT_MBYTE_IME /* Windows IME sends two '\n's with only one 'ENTER'. First: * wVirtualKeyCode == 13. second: wVirtualKeyCode == 0 */ if (ir.Event.KeyEvent.UChar == 0 --- 1611,1623 ---- } } } ! # endif if (cRecords > 0) { if (ir.EventType == KEY_EVENT && ir.Event.KeyEvent.bKeyDown) { ! # ifdef FEAT_MBYTE_IME /* Windows IME sends two '\n's with only one 'ENTER'. First: * wVirtualKeyCode == 13. second: wVirtualKeyCode == 0 */ if (ir.Event.KeyEvent.UChar == 0 *************** *** 1626,1632 **** read_console_input(g_hConIn, &ir, 1, &cRecords); continue; } ! #endif if (decode_key_event(&ir.Event.KeyEvent, &ch, &ch2, NULL, FALSE)) return TRUE; --- 1626,1632 ---- read_console_input(g_hConIn, &ir, 1, &cRecords); continue; } ! # endif if (decode_key_event(&ir.Event.KeyEvent, &ch, &ch2, NULL, FALSE)) return TRUE; *************** *** 1641,1647 **** COORD dwSize = ir.Event.WindowBufferSizeEvent.dwSize; // Only call shell_resized() when the size actually change to ! // avoid the screen is cleard. if (dwSize.X != Columns || dwSize.Y != Rows) { CONSOLE_SCREEN_BUFFER_INFO csbi; --- 1641,1647 ---- COORD dwSize = ir.Event.WindowBufferSizeEvent.dwSize; // Only call shell_resized() when the size actually change to ! // avoid the screen is cleared. if (dwSize.X != Columns || dwSize.Y != Rows) { CONSOLE_SCREEN_BUFFER_INFO csbi; *************** *** 1659,1669 **** break; } ! #ifdef FEAT_CLIENTSERVER /* Something might have been received while we were waiting. */ if (input_available()) return TRUE; ! #endif return FALSE; } --- 1659,1669 ---- break; } ! # ifdef FEAT_CLIENTSERVER /* Something might have been received while we were waiting. */ if (input_available()) return TRUE; ! # endif return FALSE; } *************** *** 1722,1734 **** INPUT_RECORD ir; DWORD cRecords = 0; ! #ifdef FEAT_CLIENTSERVER (void)WaitForChar(-1L, FALSE); if (input_available()) return 0; if (g_nMouseClick != -1) return 0; ! #endif if (read_console_input(g_hConIn, &ir, 1, &cRecords) == 0) { if (did_create_conin) --- 1722,1734 ---- INPUT_RECORD ir; DWORD cRecords = 0; ! # ifdef FEAT_CLIENTSERVER (void)WaitForChar(-1L, FALSE); if (input_available()) return 0; if (g_nMouseClick != -1) return 0; ! # endif if (read_console_input(g_hConIn, &ir, 1, &cRecords) == 0) { if (did_create_conin) *************** *** 1776,1782 **** int len; int c; ! #define TYPEAHEADLEN 20 static char_u typeahead[TYPEAHEADLEN]; /* previously typed bytes. */ static int typeaheadlen = 0; --- 1776,1782 ---- int len; int c; ! # define TYPEAHEADLEN 20 static char_u typeahead[TYPEAHEADLEN]; /* previously typed bytes. */ static int typeaheadlen = 0; *************** *** 1823,1832 **** /* we will get at least one key. Get more if they are available. */ g_fCBrkPressed = FALSE; ! #ifdef MCH_WRITE_DUMP if (fdDump) fputc('[', fdDump); ! #endif /* Keep looping until there is something in the typeahead buffer and more * to get and still room in the buffer (up to two bytes for a char and --- 1823,1832 ---- /* we will get at least one key. Get more if they are available. */ g_fCBrkPressed = FALSE; ! # ifdef MCH_WRITE_DUMP if (fdDump) fputc('[', fdDump); ! # endif /* Keep looping until there is something in the typeahead buffer and more * to get and still room in the buffer (up to two bytes for a char and *************** *** 1843,1853 **** } if (g_nMouseClick != -1) { ! #ifdef MCH_WRITE_DUMP if (fdDump) fprintf(fdDump, "{%02x @ %d, %d}", g_nMouseClick, g_xMouse, g_yMouse); ! #endif typeahead[typeaheadlen++] = ESC + 128; typeahead[typeaheadlen++] = 'M'; typeahead[typeaheadlen++] = g_nMouseClick; --- 1843,1853 ---- } if (g_nMouseClick != -1) { ! # ifdef MCH_WRITE_DUMP if (fdDump) fprintf(fdDump, "{%02x @ %d, %d}", g_nMouseClick, g_xMouse, g_yMouse); ! # endif typeahead[typeaheadlen++] = ESC + 128; typeahead[typeaheadlen++] = 'M'; typeahead[typeaheadlen++] = g_nMouseClick; *************** *** 1872,1880 **** if (c == Ctrl_C && ctrl_c_interrupts) { ! #if defined(FEAT_CLIENTSERVER) trash_input_buf(); ! #endif got_int = TRUE; } --- 1872,1880 ---- if (c == Ctrl_C && ctrl_c_interrupts) { ! # if defined(FEAT_CLIENTSERVER) trash_input_buf(); ! # endif got_int = TRUE; } *************** *** 1960,1980 **** typeaheadlen += n; ! #ifdef MCH_WRITE_DUMP if (fdDump) fputc(c, fdDump); ! #endif } } } ! #ifdef MCH_WRITE_DUMP if (fdDump) { fputs("]\n", fdDump); fflush(fdDump); } ! #endif theend: /* Move typeahead to "buf", as much as fits. */ --- 1960,1980 ---- typeaheadlen += n; ! # ifdef MCH_WRITE_DUMP if (fdDump) fputc(c, fdDump); ! # endif } } } ! # ifdef MCH_WRITE_DUMP if (fdDump) { fputs("]\n", fdDump); fflush(fdDump); } ! # endif theend: /* Move typeahead to "buf", as much as fits. */ *************** *** 2088,2096 **** static void mch_init_g(void) { ! #ifndef __MINGW32__ extern int _fmode; ! #endif /* Silently handle invalid parameters to CRT functions */ SET_INVALID_PARAM_HANDLER; --- 2088,2096 ---- static void mch_init_g(void) { ! # ifndef __MINGW32__ extern int _fmode; ! # endif /* Silently handle invalid parameters to CRT functions */ SET_INVALID_PARAM_HANDLER; *************** *** 2145,2153 **** if (!executable_exists("findstr.exe", NULL, TRUE)) set_option_value((char_u *)"grepprg", 0, (char_u *)"grep -n", 0); ! #ifdef FEAT_CLIPBOARD win_clip_init(); ! #endif vtp_flag_init(); } --- 2145,2153 ---- if (!executable_exists("findstr.exe", NULL, TRUE)) set_option_value((char_u *)"grepprg", 0, (char_u *)"grep -n", 0); ! # ifdef FEAT_CLIPBOARD win_clip_init(); ! # endif vtp_flag_init(); } *************** *** 2157,2164 **** #if !defined(FEAT_GUI_MSWIN) || defined(VIMDLL) ! #define SRWIDTH(sr) ((sr).Right - (sr).Left + 1) ! #define SRHEIGHT(sr) ((sr).Bottom - (sr).Top + 1) /* * ClearConsoleBuffer() --- 2157,2164 ---- #if !defined(FEAT_GUI_MSWIN) || defined(VIMDLL) ! # define SRWIDTH(sr) ((sr).Right - (sr).Left + 1) ! # define SRHEIGHT(sr) ((sr).Bottom - (sr).Top + 1) /* * ClearConsoleBuffer() *************** *** 2429,2442 **** return TRUE; } ! #define FEAT_RESTORE_ORIG_SCREEN ! #ifdef FEAT_RESTORE_ORIG_SCREEN static ConsoleBuffer g_cbOrig = { 0 }; ! #endif static ConsoleBuffer g_cbNonTermcap = { 0 }; static ConsoleBuffer g_cbTermcap = { 0 }; ! #ifdef FEAT_TITLE char g_szOrigTitle[256] = { 0 }; HWND g_hWnd = NULL; /* also used in os_mswin.c */ static HICON g_hOrigIconSmall = NULL; --- 2429,2442 ---- return TRUE; } ! # define FEAT_RESTORE_ORIG_SCREEN ! # ifdef FEAT_RESTORE_ORIG_SCREEN static ConsoleBuffer g_cbOrig = { 0 }; ! # endif static ConsoleBuffer g_cbNonTermcap = { 0 }; static ConsoleBuffer g_cbTermcap = { 0 }; ! # ifdef FEAT_TITLE char g_szOrigTitle[256] = { 0 }; HWND g_hWnd = NULL; /* also used in os_mswin.c */ static HICON g_hOrigIconSmall = NULL; *************** *** 2445,2456 **** static BOOL g_fCanChangeIcon = FALSE; /* ICON* are not defined in VC++ 4.0 */ ! #ifndef ICON_SMALL ! #define ICON_SMALL 0 ! #endif ! #ifndef ICON_BIG ! #define ICON_BIG 1 ! #endif /* * GetConsoleIcon() * Description: --- 2445,2456 ---- static BOOL g_fCanChangeIcon = FALSE; /* ICON* are not defined in VC++ 4.0 */ ! # ifndef ICON_SMALL ! # define ICON_SMALL 0 ! # endif ! # ifndef ICON_BIG ! # define ICON_BIG 1 ! # endif /* * GetConsoleIcon() * Description: *************** *** 2542,2548 **** if (g_hVimIcon != NULL) g_fCanChangeIcon = TRUE; } ! #endif static int g_fWindInitCalled = FALSE; static int g_fTermcapMode = FALSE; --- 2542,2548 ---- if (g_hVimIcon != NULL) g_fCanChangeIcon = TRUE; } ! # endif static int g_fWindInitCalled = FALSE; static int g_fTermcapMode = FALSE; *************** *** 2556,2567 **** static void mch_init_c(void) { ! #ifndef FEAT_RESTORE_ORIG_SCREEN CONSOLE_SCREEN_BUFFER_INFO csbi; ! #endif ! #ifndef __MINGW32__ extern int _fmode; ! #endif /* Silently handle invalid parameters to CRT functions */ SET_INVALID_PARAM_HANDLER; --- 2556,2567 ---- static void mch_init_c(void) { ! # ifndef FEAT_RESTORE_ORIG_SCREEN CONSOLE_SCREEN_BUFFER_INFO csbi; ! # endif ! # ifndef __MINGW32__ extern int _fmode; ! # endif /* Silently handle invalid parameters to CRT functions */ SET_INVALID_PARAM_HANDLER; *************** *** 2580,2594 **** create_conin(); g_hConOut = GetStdHandle(STD_OUTPUT_HANDLE); ! #ifdef FEAT_RESTORE_ORIG_SCREEN /* Save the initial console buffer for later restoration */ SaveConsoleBuffer(&g_cbOrig); g_attrCurrent = g_attrDefault = g_cbOrig.Info.wAttributes; ! #else /* Get current text attributes */ GetConsoleScreenBufferInfo(g_hConOut, &csbi); g_attrCurrent = g_attrDefault = csbi.wAttributes; ! #endif if (cterm_normal_fg_color == 0) cterm_normal_fg_color = (g_attrCurrent & 0xf) + 1; if (cterm_normal_bg_color == 0) --- 2580,2594 ---- create_conin(); g_hConOut = GetStdHandle(STD_OUTPUT_HANDLE); ! # ifdef FEAT_RESTORE_ORIG_SCREEN /* Save the initial console buffer for later restoration */ SaveConsoleBuffer(&g_cbOrig); g_attrCurrent = g_attrDefault = g_cbOrig.Info.wAttributes; ! # else /* Get current text attributes */ GetConsoleScreenBufferInfo(g_hConOut, &csbi); g_attrCurrent = g_attrDefault = csbi.wAttributes; ! # endif if (cterm_normal_fg_color == 0) cterm_normal_fg_color = (g_attrCurrent & 0xf) + 1; if (cterm_normal_bg_color == 0) *************** *** 2605,2611 **** GetConsoleMode(g_hConIn, &g_cmodein); GetConsoleMode(g_hConOut, &g_cmodeout); ! #ifdef FEAT_TITLE SaveConsoleTitleAndIcon(); /* * Set both the small and big icons of the console window to Vim's icon. --- 2605,2611 ---- GetConsoleMode(g_hConIn, &g_cmodein); GetConsoleMode(g_hConOut, &g_cmodeout); ! # ifdef FEAT_TITLE SaveConsoleTitleAndIcon(); /* * Set both the small and big icons of the console window to Vim's icon. *************** *** 2614,2624 **** */ if (g_fCanChangeIcon) SetConsoleIcon(g_hWnd, g_hVimIcon, g_hVimIcon); ! #endif ui_get_shellsize(); ! #ifdef MCH_WRITE_DUMP fdDump = fopen("dump", "wt"); if (fdDump) --- 2614,2624 ---- */ if (g_fCanChangeIcon) SetConsoleIcon(g_hWnd, g_hVimIcon, g_hVimIcon); ! # endif ui_get_shellsize(); ! # ifdef MCH_WRITE_DUMP fdDump = fopen("dump", "wt"); if (fdDump) *************** *** 2629,2643 **** fputs(ctime(&t), fdDump); fflush(fdDump); } ! #endif g_fWindInitCalled = TRUE; g_fMouseAvail = GetSystemMetrics(SM_MOUSEPRESENT); ! #ifdef FEAT_CLIPBOARD win_clip_init(); ! #endif vtp_flag_init(); vtp_init(); --- 2629,2643 ---- fputs(ctime(&t), fdDump); fflush(fdDump); } ! # endif g_fWindInitCalled = TRUE; g_fMouseAvail = GetSystemMetrics(SM_MOUSEPRESENT); ! # ifdef FEAT_CLIPBOARD win_clip_init(); ! # endif vtp_flag_init(); vtp_init(); *************** *** 2663,2669 **** if (g_fWindInitCalled) { ! #ifdef FEAT_TITLE mch_restore_title(SAVE_RESTORE_BOTH); /* * Restore both the small and big icons of the console window to --- 2663,2669 ---- if (g_fWindInitCalled) { ! # ifdef FEAT_TITLE mch_restore_title(SAVE_RESTORE_BOTH); /* * Restore both the small and big icons of the console window to *************** *** 2672,2680 **** */ if (g_fCanChangeIcon && !g_fForceExit) SetConsoleIcon(g_hWnd, g_hOrigIconSmall, g_hOrigIcon); ! #endif ! #ifdef MCH_WRITE_DUMP if (fdDump) { time_t t; --- 2672,2680 ---- */ if (g_fCanChangeIcon && !g_fForceExit) SetConsoleIcon(g_hWnd, g_hOrigIconSmall, g_hOrigIcon); ! # endif ! # ifdef MCH_WRITE_DUMP if (fdDump) { time_t t; *************** *** 2684,2699 **** fclose(fdDump); } fdDump = NULL; ! #endif } SetConsoleCursorInfo(g_hConOut, &g_cci); SetConsoleMode(g_hConIn, g_cmodein); SetConsoleMode(g_hConOut, g_cmodeout); ! #ifdef DYNAMIC_GETTEXT dyn_libintl_end(); ! #endif exit(r); } --- 2684,2699 ---- fclose(fdDump); } fdDump = NULL; ! # endif } SetConsoleCursorInfo(g_hConOut, &g_cci); SetConsoleMode(g_hConIn, g_cmodein); SetConsoleMode(g_hConOut, g_cmodeout); ! # ifdef DYNAMIC_GETTEXT dyn_libintl_end(); ! # endif exit(r); } *************** *** 3104,3110 **** /* * Get the by-handle-file-information for "fname". * Returns FILEINFO_OK when OK. ! * returns FILEINFO_ENC_FAIL when enc_to_utf16() failed. * Returns FILEINFO_READ_FAIL when CreateFile() failed. * Returns FILEINFO_INFO_FAIL when GetFileInformationByHandle() failed. */ --- 3104,3110 ---- /* * Get the by-handle-file-information for "fname". * Returns FILEINFO_OK when OK. ! * Returns FILEINFO_ENC_FAIL when enc_to_utf16() failed. * Returns FILEINFO_READ_FAIL when CreateFile() failed. * Returns FILEINFO_INFO_FAIL when GetFileInformationByHandle() failed. */ *************** *** 3531,3539 **** : dwCtrlType == CTRL_LOGOFF_EVENT ? _("logoff") : _("shutdown"))); ! #ifdef DEBUG OutputDebugString(IObuff); ! #endif preserve_exit(); /* output IObuff, preserve files and exit */ --- 3531,3539 ---- : dwCtrlType == CTRL_LOGOFF_EVENT ? _("logoff") : _("shutdown"))); ! # ifdef DEBUG OutputDebugString(IObuff); ! # endif preserve_exit(); /* output IObuff, preserve files and exit */ *************** *** 3568,3580 **** if (g_fMouseActive) cmodein |= ENABLE_MOUSE_INPUT; cmodeout &= ~( ! #ifdef FEAT_TERMGUICOLORS /* Do not turn off the ENABLE_PROCESSED_OUTPUT flag when using * VTP. */ ((vtp_working) ? 0 : ENABLE_PROCESSED_OUTPUT) | ! #else ENABLE_PROCESSED_OUTPUT | ! #endif ENABLE_WRAP_AT_EOL_OUTPUT); bEnableHandler = TRUE; } --- 3568,3580 ---- if (g_fMouseActive) cmodein |= ENABLE_MOUSE_INPUT; cmodeout &= ~( ! # ifdef FEAT_TERMGUICOLORS /* Do not turn off the ENABLE_PROCESSED_OUTPUT flag when using * VTP. */ ((vtp_working) ? 0 : ENABLE_PROCESSED_OUTPUT) | ! # else ENABLE_PROCESSED_OUTPUT | ! # endif ENABLE_WRAP_AT_EOL_OUTPUT); bEnableHandler = TRUE; } *************** *** 3589,3595 **** SetConsoleMode(g_hConOut, cmodeout); SetConsoleCtrlHandler(handler_routine, bEnableHandler); ! #ifdef MCH_WRITE_DUMP if (fdDump) { fprintf(fdDump, "mch_settmode(%s, in = %x, out = %x)\n", --- 3589,3595 ---- SetConsoleMode(g_hConOut, cmodeout); SetConsoleCtrlHandler(handler_routine, bEnableHandler); ! # ifdef MCH_WRITE_DUMP if (fdDump) { fprintf(fdDump, "mch_settmode(%s, in = %x, out = %x)\n", *************** *** 3598,3604 **** cmodein, cmodeout); fflush(fdDump); } ! #endif } --- 3598,3604 ---- cmodein, cmodeout); fflush(fdDump); } ! # endif } *************** *** 3649,3662 **** { if (!SetConsoleScreenBufferSize(hConsole, coordScreen)) { ! #ifdef MCH_WRITE_DUMP if (fdDump) { fprintf(fdDump, "SetConsoleScreenBufferSize failed: %lx\n", GetLastError()); fflush(fdDump); } ! #endif } } --- 3649,3662 ---- { if (!SetConsoleScreenBufferSize(hConsole, coordScreen)) { ! # ifdef MCH_WRITE_DUMP if (fdDump) { fprintf(fdDump, "SetConsoleScreenBufferSize failed: %lx\n", GetLastError()); fflush(fdDump); } ! # endif } } *************** *** 3670,3683 **** { if (!SetConsoleWindowInfo(hConsole, TRUE, &srWindowRect)) { ! #ifdef MCH_WRITE_DUMP if (fdDump) { fprintf(fdDump, "SetConsoleWindowInfo failed: %lx\n", GetLastError()); fflush(fdDump); } ! #endif } } --- 3670,3683 ---- { if (!SetConsoleWindowInfo(hConsole, TRUE, &srWindowRect)) { ! # ifdef MCH_WRITE_DUMP if (fdDump) { fprintf(fdDump, "SetConsoleWindowInfo failed: %lx\n", GetLastError()); fflush(fdDump); } ! # endif } } *************** *** 3696,3708 **** COORD cursor; static int resized = FALSE; ! #ifdef MCH_WRITE_DUMP if (fdDump) { fprintf(fdDump, "ResizeConBufAndWindow(%d, %d)\n", xSize, ySize); fflush(fdDump); } ! #endif /* get the largest size we can size the console window to */ coordScreen = GetLargestConsoleWindowSize(hConsole); --- 3696,3708 ---- COORD cursor; static int resized = FALSE; ! # ifdef MCH_WRITE_DUMP if (fdDump) { fprintf(fdDump, "ResizeConBufAndWindow(%d, %d)\n", xSize, ySize); fflush(fdDump); } ! # endif /* get the largest size we can size the console window to */ coordScreen = GetLargestConsoleWindowSize(hConsole); *************** *** 3923,3929 **** /* Wait for the command to terminate before continuing */ { ! #ifdef FEAT_GUI int delay = 1; /* Keep updating the window while waiting for the shell to finish. */ --- 3923,3929 ---- /* Wait for the command to terminate before continuing */ { ! # ifdef FEAT_GUI int delay = 1; /* Keep updating the window while waiting for the shell to finish. */ *************** *** 3947,3955 **** if (delay < 50) delay += 10; } ! #else WaitForSingleObject(pi.hProcess, INFINITE); ! #endif /* Get the command exit code */ GetExitCodeProcess(pi.hProcess, &ret); --- 3947,3955 ---- if (delay < 50) delay += 10; } ! # else WaitForSingleObject(pi.hProcess, INFINITE); ! # endif /* Get the command exit code */ GetExitCodeProcess(pi.hProcess, &ret); *************** *** 5450,5458 **** ResizeConBufAndWindow(g_hConOut, Columns, Rows); } ! #ifdef FEAT_TITLE resettitle(); ! #endif GetConsoleMode(g_hConIn, &cmodein); if (g_fMouseActive) --- 5450,5458 ---- ResizeConBufAndWindow(g_hConOut, Columns, Rows); } ! # ifdef FEAT_TITLE resettitle(); ! # endif GetConsoleMode(g_hConIn, &cmodein); if (g_fMouseActive) *************** *** 5487,5497 **** cmodein &= ~(ENABLE_MOUSE_INPUT | ENABLE_WINDOW_INPUT); SetConsoleMode(g_hConIn, cmodein); ! #ifdef FEAT_RESTORE_ORIG_SCREEN cb = exiting ? &g_cbOrig : &g_cbNonTermcap; ! #else cb = &g_cbNonTermcap; ! #endif RestoreConsoleBuffer(cb, p_rs); reset_console_color_rgb(); SetConsoleCursorInfo(g_hConOut, &g_cci); --- 5487,5497 ---- cmodein &= ~(ENABLE_MOUSE_INPUT | ENABLE_WINDOW_INPUT); SetConsoleMode(g_hConIn, cmodein); ! # ifdef FEAT_RESTORE_ORIG_SCREEN cb = exiting ? &g_cbOrig : &g_cbNonTermcap; ! # else cb = &g_cbNonTermcap; ! # endif RestoreConsoleBuffer(cb, p_rs); reset_console_color_rgb(); SetConsoleCursorInfo(g_hConOut, &g_cci); *************** *** 5921,5929 **** cterm_normal_fg_color = (g_attrDefault & 0xf) + 1; cterm_normal_bg_color = ((g_attrDefault >> 4) & 0xf) + 1; if ( ! #ifdef FEAT_TERMGUICOLORS !p_tgc && ! #endif T_ME[0] == ESC && T_ME[1] == '|') { p = T_ME + 2; --- 5921,5929 ---- cterm_normal_fg_color = (g_attrDefault & 0xf) + 1; cterm_normal_bg_color = ((g_attrDefault >> 4) & 0xf) + 1; if ( ! # ifdef FEAT_TERMGUICOLORS !p_tgc && ! # endif T_ME[0] == ESC && T_ME[1] == '|') { p = T_ME + 2; *************** *** 5934,5943 **** cterm_normal_bg_color = ((n >> 4) & 0xf) + 1; } } ! #ifdef FEAT_TERMGUICOLORS cterm_normal_fg_gui_color = INVALCOLOR; cterm_normal_bg_gui_color = INVALCOLOR; ! #endif } --- 5934,5943 ---- cterm_normal_bg_color = ((n >> 4) & 0xf) + 1; } } ! # ifdef FEAT_TERMGUICOLORS cterm_normal_fg_gui_color = INVALCOLOR; cterm_normal_bg_gui_color = INVALCOLOR; ! # endif } *************** *** 5975,5983 **** cursor_visible(BOOL fVisible) { s_cursor_visible = fVisible; ! #ifdef MCH_CURSOR_SHAPE mch_update_cursor(); ! #endif } --- 5975,5983 ---- cursor_visible(BOOL fVisible) { s_cursor_visible = fVisible; ! # ifdef MCH_CURSOR_SHAPE mch_update_cursor(); ! # endif } *************** *** 6096,6109 **** DWORD nWritten; nWritten = write_chars(s, prefix); ! #ifdef MCH_WRITE_DUMP if (fdDump) { fputc('>', fdDump); fwrite(s, sizeof(char_u), nWritten, fdDump); fputs("<\n", fdDump); } ! #endif len -= (nWritten - 1); s += nWritten; } --- 6096,6109 ---- DWORD nWritten; nWritten = write_chars(s, prefix); ! # ifdef MCH_WRITE_DUMP if (fdDump) { fputc('>', fdDump); fwrite(s, sizeof(char_u), nWritten, fdDump); fputs("<\n", fdDump); } ! # endif len -= (nWritten - 1); s += nWritten; } *************** *** 6119,6138 **** { gotoxy(g_srScrollRegion.Left + 1, g_coord.Y + 2); } ! #ifdef MCH_WRITE_DUMP if (fdDump) fputs("\\n\n", fdDump); ! #endif s++; } else if (s[0] == '\r') { /* \r, carriage return: go to beginning of line */ gotoxy(g_srScrollRegion.Left+1, g_coord.Y + 1); ! #ifdef MCH_WRITE_DUMP if (fdDump) fputs("\\r\n", fdDump); ! #endif s++; } else if (s[0] == '\b') --- 6119,6138 ---- { gotoxy(g_srScrollRegion.Left + 1, g_coord.Y + 2); } ! # ifdef MCH_WRITE_DUMP if (fdDump) fputs("\\n\n", fdDump); ! # endif s++; } else if (s[0] == '\r') { /* \r, carriage return: go to beginning of line */ gotoxy(g_srScrollRegion.Left+1, g_coord.Y + 1); ! # ifdef MCH_WRITE_DUMP if (fdDump) fputs("\\r\n", fdDump); ! # endif s++; } else if (s[0] == '\b') *************** *** 6146,6172 **** g_coord.Y--; } gotoxy(g_coord.X + 1, g_coord.Y + 1); ! #ifdef MCH_WRITE_DUMP if (fdDump) fputs("\\b\n", fdDump); ! #endif s++; } else if (s[0] == '\a') { /* \a, bell */ MessageBeep(0xFFFFFFFF); ! #ifdef MCH_WRITE_DUMP if (fdDump) fputs("\\a\n", fdDump); ! #endif s++; } else if (s[0] == ESC && len >= 3-1 && s[1] == '|') { ! #ifdef MCH_WRITE_DUMP char_u *old_s = s; ! #endif char_u *p; int arg1 = 0, arg2 = 0, argc = 0, args[16]; --- 6146,6172 ---- g_coord.Y--; } gotoxy(g_coord.X + 1, g_coord.Y + 1); ! # ifdef MCH_WRITE_DUMP if (fdDump) fputs("\\b\n", fdDump); ! # endif s++; } else if (s[0] == '\a') { /* \a, bell */ MessageBeep(0xFFFFFFFF); ! # ifdef MCH_WRITE_DUMP if (fdDump) fputs("\\a\n", fdDump); ! # endif s++; } else if (s[0] == ESC && len >= 3-1 && s[1] == '|') { ! # ifdef MCH_WRITE_DUMP char_u *old_s = s; ! # endif char_u *p; int arg1 = 0, arg2 = 0, argc = 0, args[16]; *************** *** 6321,6334 **** len -= 2; } ! #ifdef MCH_WRITE_DUMP if (fdDump) { fputs("ESC | ", fdDump); fwrite(old_s + 2, sizeof(char_u), s - old_s - 2, fdDump); fputc('\n', fdDump); } ! #endif } else { --- 6321,6334 ---- len -= 2; } ! # ifdef MCH_WRITE_DUMP if (fdDump) { fputs("ESC | ", fdDump); fwrite(old_s + 2, sizeof(char_u), s - old_s - 2, fdDump); fputc('\n', fdDump); } ! # endif } else { *************** *** 6336,6359 **** DWORD nWritten; nWritten = write_chars(s, 1); ! #ifdef MCH_WRITE_DUMP if (fdDump) { fputc('>', fdDump); fwrite(s, sizeof(char_u), nWritten, fdDump); fputs("<\n", fdDump); } ! #endif len -= (nWritten - 1); s += nWritten; } } ! #ifdef MCH_WRITE_DUMP if (fdDump) fflush(fdDump); ! #endif } #endif /* FEAT_GUI_MSWIN */ --- 6336,6359 ---- DWORD nWritten; nWritten = write_chars(s, 1); ! # ifdef MCH_WRITE_DUMP if (fdDump) { fputc('>', fdDump); fwrite(s, sizeof(char_u), nWritten, fdDump); fputs("<\n", fdDump); } ! # endif len -= (nWritten - 1); s += nWritten; } } ! # ifdef MCH_WRITE_DUMP if (fdDump) fflush(fdDump); ! # endif } #endif /* FEAT_GUI_MSWIN */ *************** *** 7135,7141 **** { int literal = used_file_literal; ! # ifdef FEAT_DIFF /* When using diff mode may need to concatenate file name to * directory name. Just like it's done in main(). */ if (used_file_diff_mode && mch_isdir(str) && GARGCOUNT > 0 --- 7135,7141 ---- { int literal = used_file_literal; ! #ifdef FEAT_DIFF /* When using diff mode may need to concatenate file name to * directory name. Just like it's done in main(). */ if (used_file_diff_mode && mch_isdir(str) && GARGCOUNT > 0 *************** *** 7150,7156 **** str = r; } } ! # endif /* Re-use the old buffer by renaming it. When not using literal * names it's done by alist_expand() below. */ if (used_file_literal) --- 7150,7156 ---- str = r; } } ! #endif /* Re-use the old buffer by renaming it. When not using literal * names it's done by alist_expand() below. */ if (used_file_literal) *** ../vim-8.1.2375/src/proto.h 2019-11-30 22:47:42.655331183 +0100 --- src/proto.h 2019-12-01 18:52:53.336261462 +0100 *************** *** 113,164 **** # include "arabic.pro" # endif # ifdef FEAT_VIMINFO ! # include "viminfo.pro" # endif // These prototypes cannot be produced automatically. int smsg(const char *, ...) ! #ifdef USE_PRINTF_FORMAT_ATTRIBUTE __attribute__((format(printf, 1, 0))) ! #endif ; int smsg_attr(int, const char *, ...) ! #ifdef USE_PRINTF_FORMAT_ATTRIBUTE __attribute__((format(printf, 2, 3))) ! #endif ; int smsg_attr_keep(int, const char *, ...) ! #ifdef USE_PRINTF_FORMAT_ATTRIBUTE __attribute__((format(printf, 2, 3))) ! #endif ; // These prototypes cannot be produced automatically. int semsg(const char *, ...) ! #ifdef USE_PRINTF_FORMAT_ATTRIBUTE __attribute__((format(printf, 1, 0))) ! #endif ; // These prototypes cannot be produced automatically. void siemsg(const char *, ...) ! #ifdef USE_PRINTF_FORMAT_ATTRIBUTE __attribute__((format(printf, 1, 0))) ! #endif ; int vim_snprintf_add(char *, size_t, const char *, ...) ! #ifdef USE_PRINTF_FORMAT_ATTRIBUTE __attribute__((format(printf, 3, 4))) ! #endif ; int vim_snprintf(char *, size_t, const char *, ...) ! #ifdef USE_PRINTF_FORMAT_ATTRIBUTE __attribute__((format(printf, 3, 4))) ! #endif ; int vim_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap); --- 113,164 ---- # include "arabic.pro" # endif # ifdef FEAT_VIMINFO ! # include "viminfo.pro" # endif // These prototypes cannot be produced automatically. int smsg(const char *, ...) ! # ifdef USE_PRINTF_FORMAT_ATTRIBUTE __attribute__((format(printf, 1, 0))) ! # endif ; int smsg_attr(int, const char *, ...) ! # ifdef USE_PRINTF_FORMAT_ATTRIBUTE __attribute__((format(printf, 2, 3))) ! # endif ; int smsg_attr_keep(int, const char *, ...) ! # ifdef USE_PRINTF_FORMAT_ATTRIBUTE __attribute__((format(printf, 2, 3))) ! # endif ; // These prototypes cannot be produced automatically. int semsg(const char *, ...) ! # ifdef USE_PRINTF_FORMAT_ATTRIBUTE __attribute__((format(printf, 1, 0))) ! # endif ; // These prototypes cannot be produced automatically. void siemsg(const char *, ...) ! # ifdef USE_PRINTF_FORMAT_ATTRIBUTE __attribute__((format(printf, 1, 0))) ! # endif ; int vim_snprintf_add(char *, size_t, const char *, ...) ! # ifdef USE_PRINTF_FORMAT_ATTRIBUTE __attribute__((format(printf, 3, 4))) ! # endif ; int vim_snprintf(char *, size_t, const char *, ...) ! # ifdef USE_PRINTF_FORMAT_ATTRIBUTE __attribute__((format(printf, 3, 4))) ! # endif ; int vim_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap); *************** *** 167,179 **** # include "message.pro" # include "misc1.pro" # include "misc2.pro" ! #ifndef HAVE_STRPBRK // not generated automatically from misc2.c char_u *vim_strpbrk(char_u *s, char_u *charset); ! #endif ! #ifndef HAVE_QSORT // Use our own qsort(), don't define the prototype when not used. void qsort(void *base, size_t elm_count, size_t elm_size, int (*cmp)(const void *, const void *)); ! #endif # include "mouse.pro" # include "move.pro" # include "mbyte.pro" --- 167,179 ---- # include "message.pro" # include "misc1.pro" # include "misc2.pro" ! # ifndef HAVE_STRPBRK // not generated automatically from misc2.c char_u *vim_strpbrk(char_u *s, char_u *charset); ! # endif ! # ifndef HAVE_QSORT // Use our own qsort(), don't define the prototype when not used. void qsort(void *base, size_t elm_count, size_t elm_size, int (*cmp)(const void *, const void *)); ! # endif # include "mouse.pro" # include "move.pro" # include "mbyte.pro" *************** *** 188,194 **** # include "optionstr.pro" # include "popupmenu.pro" # if defined(FEAT_PROFILE) || defined(FEAT_RELTIME) ! # include "profiler.pro" # endif # include "quickfix.pro" # include "regexp.pro" --- 188,194 ---- # include "optionstr.pro" # include "popupmenu.pro" # if defined(FEAT_PROFILE) || defined(FEAT_RELTIME) ! # include "profiler.pro" # endif # include "quickfix.pro" # include "regexp.pro" *************** *** 269,277 **** // Not generated automatically, to add extra attribute. void ch_log(channel_T *ch, const char *fmt, ...) ! #ifdef USE_PRINTF_FORMAT_ATTRIBUTE __attribute__((format(printf, 2, 3))) ! #endif ; # endif --- 269,277 ---- // Not generated automatically, to add extra attribute. void ch_log(channel_T *ch, const char *fmt, ...) ! # ifdef USE_PRINTF_FORMAT_ATTRIBUTE __attribute__((format(printf, 2, 3))) ! # endif ; # endif *************** *** 332,351 **** * not included here for the perl files. Use a dummy define for CV for the * other files. */ ! #if defined(FEAT_PERL) && !defined(IN_PERL_FILE) ! # define CV void ! # include "if_perl.pro" ! # include "if_perlsfio.pro" ! #endif ! ! #ifdef MACOS_CONVERT ! # include "os_mac_conv.pro" ! #endif ! #if defined(MACOS_X_DARWIN) && defined(FEAT_CLIPBOARD) && !defined(FEAT_GUI) // functions in os_macosx.m void clip_mch_lose_selection(Clipboard_T *cbd); int clip_mch_own_selection(Clipboard_T *cbd); void clip_mch_request_selection(Clipboard_T *cbd); void clip_mch_set_selection(Clipboard_T *cbd); ! #endif #endif // !PROTO && !NOPROTO --- 332,351 ---- * not included here for the perl files. Use a dummy define for CV for the * other files. */ ! # if defined(FEAT_PERL) && !defined(IN_PERL_FILE) ! # define CV void ! # include "if_perl.pro" ! # include "if_perlsfio.pro" ! # endif ! ! # ifdef MACOS_CONVERT ! # include "os_mac_conv.pro" ! # endif ! # if defined(MACOS_X_DARWIN) && defined(FEAT_CLIPBOARD) && !defined(FEAT_GUI) // functions in os_macosx.m void clip_mch_lose_selection(Clipboard_T *cbd); int clip_mch_own_selection(Clipboard_T *cbd); void clip_mch_request_selection(Clipboard_T *cbd); void clip_mch_set_selection(Clipboard_T *cbd); ! # endif #endif // !PROTO && !NOPROTO *** ../vim-8.1.2375/src/version.c 2019-12-01 18:16:14.553582042 +0100 --- src/version.c 2019-12-01 18:57:38.638993194 +0100 *************** *** 744,745 **** --- 744,747 ---- { /* Add new patch number below this line */ + /**/ + 2376, /**/ -- hundred-and-one symptoms of being an internet addict: 168. You have your own domain name. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///