To: vim_dev@googlegroups.com Subject: Patch 8.2.4294 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4294 Problem: MS-Windows: #ifdefs for Cygwin are too complicated. Solution: Simplify the conditions. (Ken Takata, closes #9693) Files: src/evalfunc.c, src/main.c, src/os_unix.c, src/os_win32.c, src/os_win32.h *** ../vim-8.2.4293/src/evalfunc.c 2022-02-02 20:01:21.957210955 +0000 --- src/evalfunc.c 2022-02-04 10:42:23.864765810 +0000 *************** *** 5196,5202 **** #endif }, {"win32unix", ! #if defined(UNIX) && defined(__CYGWIN__) 1 #else 0 --- 5196,5202 ---- #endif }, {"win32unix", ! #ifdef WIN32UNIX 1 #else 0 *** ../vim-8.2.4293/src/main.c 2022-01-29 13:06:19.340028690 +0000 --- src/main.c 2022-02-04 10:42:23.864765810 +0000 *************** *** 11,21 **** #include "vim.h" #ifdef __CYGWIN__ ! # ifndef MSWIN ! # include ! # include // for cygwin_conv_to_posix_path() and/or // cygwin_conv_path() - # endif # include #endif --- 11,19 ---- #include "vim.h" #ifdef __CYGWIN__ ! # include ! # include // for cygwin_conv_to_posix_path() and/or // cygwin_conv_path() # include #endif *************** *** 2570,2576 **** } } #endif ! #if defined(__CYGWIN32__) && !defined(MSWIN) /* * If vim is invoked by non-Cygwin tools, convert away any * DOS paths, so things like .swp files are created correctly. --- 2568,2574 ---- } } #endif ! #ifdef __CYGWIN32__ /* * If vim is invoked by non-Cygwin tools, convert away any * DOS paths, so things like .swp files are created correctly. *** ../vim-8.2.4293/src/os_unix.c 2022-01-31 14:59:33.522943638 +0000 --- src/os_unix.c 2022-02-04 10:42:23.864765810 +0000 *************** *** 44,58 **** #endif #ifdef __CYGWIN__ ! # ifndef MSWIN ! # include ! # include // for cygwin_conv_to_posix_path() and/or // for cygwin_conv_path() ! # ifdef FEAT_CYGWIN_WIN32_CLIPBOARD ! # define WIN32_LEAN_AND_MEAN ! # include ! # include "winclip.pro" ! # endif # endif #endif --- 44,56 ---- #endif #ifdef __CYGWIN__ ! # include ! # include // for cygwin_conv_to_posix_path() and/or // for cygwin_conv_path() ! # ifdef FEAT_CYGWIN_WIN32_CLIPBOARD ! # define WIN32_LEAN_AND_MEAN ! # include ! # include "winclip.pro" # endif #endif *** ../vim-8.2.4293/src/os_win32.c 2022-02-03 13:32:59.266208214 +0000 --- src/os_win32.c 2022-02-04 10:42:23.864765810 +0000 *************** *** 241,252 **** static BOOL win8_or_later = FALSE; - #if defined(__GNUC__) && !defined(__MINGW32__) && !defined(__CYGWIN__) - # define UChar UnicodeChar - #else - # define UChar uChar.UnicodeChar - #endif - #if !defined(FEAT_GUI_MSWIN) || defined(VIMDLL) // Dynamic loading for portability typedef struct _DYN_CONSOLE_SCREEN_BUFFER_INFOEX --- 241,246 ---- *************** *** 306,312 **** && ir->Event.KeyEvent.wRepeatCount == 1 && ir->Event.KeyEvent.wVirtualKeyCode == 0x12 && ir->Event.KeyEvent.wVirtualScanCode == 0x38 ! && ir->Event.KeyEvent.UChar == 0 && ir->Event.KeyEvent.dwControlKeyState == 2; } --- 300,306 ---- && ir->Event.KeyEvent.wRepeatCount == 1 && ir->Event.KeyEvent.wVirtualKeyCode == 0x12 && ir->Event.KeyEvent.wVirtualScanCode == 0x38 ! && ir->Event.KeyEvent.uChar.UnicodeChar == 0 && ir->Event.KeyEvent.dwControlKeyState == 2; } *************** *** 317,323 **** { down->Event.KeyEvent.wVirtualKeyCode = 0; down->Event.KeyEvent.wVirtualScanCode = 0; ! down->Event.KeyEvent.UChar = up->Event.KeyEvent.UChar; down->Event.KeyEvent.dwControlKeyState = 0; } --- 311,318 ---- { down->Event.KeyEvent.wVirtualKeyCode = 0; down->Event.KeyEvent.wVirtualScanCode = 0; ! down->Event.KeyEvent.uChar.UnicodeChar ! = up->Event.KeyEvent.uChar.UnicodeChar; down->Event.KeyEvent.dwControlKeyState = 0; } *************** *** 1005,1016 **** if (s_iIsDead == 2) { ! pker->UChar = (WCHAR) awAnsiCode[1]; s_iIsDead = 0; return 1; } ! if (pker->UChar != 0) return 1; CLEAR_FIELD(abKeystate); --- 1000,1011 ---- if (s_iIsDead == 2) { ! pker->uChar.UnicodeChar = (WCHAR) awAnsiCode[1]; s_iIsDead = 0; return 1; } ! if (pker->uChar.UnicodeChar != 0) return 1; CLEAR_FIELD(abKeystate); *************** *** 1033,1039 **** abKeystate, awAnsiCode, 2, 0); if (s_iIsDead > 0) ! pker->UChar = (WCHAR) awAnsiCode[0]; return s_iIsDead; } --- 1028,1034 ---- abKeystate, awAnsiCode, 2, 0); if (s_iIsDead > 0) ! pker->uChar.UnicodeChar = (WCHAR) awAnsiCode[0]; return s_iIsDead; } *************** *** 1075,1081 **** } // special cases ! if ((nModifs & CTRL) != 0 && (nModifs & ~CTRL) == 0 && pker->UChar == NUL) { // Ctrl-6 is Ctrl-^ if (pker->wVirtualKeyCode == '6') --- 1070,1077 ---- } // special cases ! if ((nModifs & CTRL) != 0 && (nModifs & ~CTRL) == 0 ! && pker->uChar.UnicodeChar == NUL) { // Ctrl-6 is Ctrl-^ if (pker->wVirtualKeyCode == '6') *************** *** 1137,1143 **** *pch = NUL; else { ! *pch = (i > 0) ? pker->UChar : NUL; if (pmodifiers != NULL) { --- 1133,1139 ---- *pch = NUL; else { ! *pch = (i > 0) ? pker->uChar.UnicodeChar : NUL; if (pmodifiers != NULL) { *************** *** 1683,1689 **** # 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 && ir.Event.KeyEvent.wVirtualKeyCode == 13) { read_console_input(g_hConIn, &ir, 1, &cRecords); --- 1679,1685 ---- # 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.UnicodeChar == 0 && ir.Event.KeyEvent.wVirtualKeyCode == 13) { read_console_input(g_hConIn, &ir, 1, &cRecords); *** ../vim-8.2.4293/src/os_win32.h 2022-01-24 11:23:59.859900461 +0000 --- src/os_win32.h 2022-02-04 10:42:23.864765810 +0000 *************** *** 11,21 **** */ #include "os_dos.h" // common MS-DOS and Win32 stuff - #ifndef __CYGWIN__ // cproto fails on missing include files ! # ifndef PROTO ! # include // for _mkdir() ! # endif #endif #define BINARY_FILE_IO --- 11,19 ---- */ #include "os_dos.h" // common MS-DOS and Win32 stuff // cproto fails on missing include files ! #ifndef PROTO ! # include // for _mkdir() #endif #define BINARY_FILE_IO *** ../vim-8.2.4293/src/version.c 2022-02-03 21:47:30.562148940 +0000 --- src/version.c 2022-02-04 10:43:53.160520717 +0000 *************** *** 748,749 **** --- 748,751 ---- { /* Add new patch number below this line */ + /**/ + 4294, /**/ -- The process for understanding customers primarily involves sitting around with other marketing people and talking about what you would to if you were dumb enough to be a customer. (Scott Adams - The Dilbert principle) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///