To: vim_dev@googlegroups.com Subject: Patch 8.1.1104 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.1104 Problem: MS-Windows: not all environment variables can be used. Solution: Use the wide version of WinMain() and main(). (Ken Takata, closes #4206) Files: src/Make_cyg.mak, src/Make_cyg_ming.mak, src/Make_mvc.mak, src/main.c, src/os_w32exe.c *** ../vim-8.1.1103/src/Make_cyg.mak 2017-09-23 19:38:55.000000000 +0200 --- src/Make_cyg.mak 2019-04-03 20:28:04.221969137 +0200 *************** *** 37,49 **** #RUBY=/cygdribe/c/ruby ! # Use MinGW(-w64) cross compiler. ! # There are three MinGW packages in Cygwin: ! # 32-bit: mingw-gcc-g++ and mingw64-i686-gcc-g++ # 64-bit: mingw64-x86_64-gcc-g++ # You may also need to set 'ARCH' in Make_cyg_ming.mak. ! CROSS_COMPILE = i686-pc-mingw32- ! #CROSS_COMPILE = i686-w64-mingw32- #CROSS_COMPILE = x86_64-w64-mingw32- --- 37,48 ---- #RUBY=/cygdribe/c/ruby ! # Use MinGW-w64 cross compiler. ! # There are two MinGW-w64 packages in Cygwin: ! # 32-bit: mingw64-i686-gcc-g++ # 64-bit: mingw64-x86_64-gcc-g++ # You may also need to set 'ARCH' in Make_cyg_ming.mak. ! CROSS_COMPILE = i686-w64-mingw32- #CROSS_COMPILE = x86_64-w64-mingw32- *** ../vim-8.1.1103/src/Make_cyg_ming.mak 2019-03-30 13:53:26.166425144 +0100 --- src/Make_cyg_ming.mak 2019-04-03 20:28:04.221969137 +0200 *************** *** 691,697 **** endif LIB = -lkernel32 -luser32 -lgdi32 -ladvapi32 -lcomdlg32 -lcomctl32 -lnetapi32 -lversion ! GUIOBJ = $(OUTDIR)/gui.o $(OUTDIR)/gui_w32.o $(OUTDIR)/gui_beval.o $(OUTDIR)/os_w32exe.o CUIOBJ = $(OUTDIR)/iscygpty.o OBJ = \ $(OUTDIR)/arabic.o \ --- 691,697 ---- endif LIB = -lkernel32 -luser32 -lgdi32 -ladvapi32 -lcomdlg32 -lcomctl32 -lnetapi32 -lversion ! GUIOBJ = $(OUTDIR)/gui.o $(OUTDIR)/gui_w32.o $(OUTDIR)/gui_beval.o CUIOBJ = $(OUTDIR)/iscygpty.o OBJ = \ $(OUTDIR)/arabic.o \ *************** *** 737,745 **** $(OUTDIR)/normal.o \ $(OUTDIR)/ops.o \ $(OUTDIR)/option.o \ - $(OUTDIR)/os_win32.o \ $(OUTDIR)/os_mswin.o \ ! $(OUTDIR)/winclip.o \ $(OUTDIR)/pathdef.o \ $(OUTDIR)/popupmnu.o \ $(OUTDIR)/quickfix.o \ --- 737,745 ---- $(OUTDIR)/normal.o \ $(OUTDIR)/ops.o \ $(OUTDIR)/option.o \ $(OUTDIR)/os_mswin.o \ ! $(OUTDIR)/os_w32exe.o \ ! $(OUTDIR)/os_win32.o \ $(OUTDIR)/pathdef.o \ $(OUTDIR)/popupmnu.o \ $(OUTDIR)/quickfix.o \ *************** *** 759,764 **** --- 759,765 ---- $(OUTDIR)/userfunc.o \ $(OUTDIR)/version.o \ $(OUTDIR)/vimrc.o \ + $(OUTDIR)/winclip.o \ $(OUTDIR)/window.o ifdef PERL *************** *** 865,870 **** --- 866,873 ---- MZSCHEME_SUFFIX = Z endif + LFLAGS += -municode + ifeq ($(GUI),yes) TARGET := gvim$(DEBUG_SUFFIX).exe DEFINES += $(DEF_GUI) *** ../vim-8.1.1103/src/Make_mvc.mak 2019-03-30 13:53:26.166425144 +0100 --- src/Make_mvc.mak 2019-04-03 20:28:04.221969137 +0200 *************** *** 742,748 **** $(OUTDIR)\ops.obj \ $(OUTDIR)\option.obj \ $(OUTDIR)\os_mswin.obj \ ! $(OUTDIR)\winclip.obj \ $(OUTDIR)\os_win32.obj \ $(OUTDIR)\pathdef.obj \ $(OUTDIR)\popupmnu.obj \ --- 742,748 ---- $(OUTDIR)\ops.obj \ $(OUTDIR)\option.obj \ $(OUTDIR)\os_mswin.obj \ ! $(OUTDIR)\os_w32exe.obj \ $(OUTDIR)\os_win32.obj \ $(OUTDIR)\pathdef.obj \ $(OUTDIR)\popupmnu.obj \ *************** *** 761,766 **** --- 761,767 ---- $(OUTDIR)\ui.obj \ $(OUTDIR)\undo.obj \ $(OUTDIR)\userfunc.obj \ + $(OUTDIR)\winclip.obj \ $(OUTDIR)\window.obj \ $(OUTDIR)\vim.res *************** *** 799,806 **** GUI_OBJ = \ $(OUTDIR)\gui.obj \ $(OUTDIR)\gui_beval.obj \ ! $(OUTDIR)\gui_w32.obj \ ! $(OUTDIR)\os_w32exe.obj GUI_LIB = \ gdi32.lib version.lib $(IME_LIB) \ winspool.lib comctl32.lib advapi32.lib shell32.lib netapi32.lib \ --- 800,806 ---- GUI_OBJ = \ $(OUTDIR)\gui.obj \ $(OUTDIR)\gui_beval.obj \ ! $(OUTDIR)\gui_w32.obj GUI_LIB = \ gdi32.lib version.lib $(IME_LIB) \ winspool.lib comctl32.lib advapi32.lib shell32.lib netapi32.lib \ *** ../vim-8.1.1103/src/main.c 2019-03-28 22:43:12.103997449 +0100 --- src/main.c 2019-04-03 20:28:04.225969114 +0200 *************** *** 96,102 **** static int has_dash_c_arg = FALSE; int ! # ifdef FEAT_GUI_MSWIN # ifdef __BORLANDC__ _cdecl # endif --- 96,102 ---- static int has_dash_c_arg = FALSE; int ! # ifdef MSWIN # ifdef __BORLANDC__ _cdecl # endif *** ../vim-8.1.1103/src/os_w32exe.c 2019-04-02 22:02:28.606347252 +0200 --- src/os_w32exe.c 2019-04-03 20:28:04.225969114 +0200 *************** *** 28,47 **** #endif #ifndef PROTO int WINAPI ! WinMain( HINSTANCE hInstance, HINSTANCE hPrevInst UNUSED, ! LPSTR lpszCmdLine UNUSED, int nCmdShow UNUSED) { - int argc = 0; - char **argv = NULL; - # ifdef FEAT_GUI SaveInst(hInstance); # endif ! VimMain(argc, argv); return 0; } --- 28,49 ---- #endif #ifndef PROTO + # ifdef FEAT_GUI int WINAPI ! wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInst UNUSED, ! LPWSTR lpszCmdLine UNUSED, int nCmdShow UNUSED) + # else + int + wmain(int argc UNUSED, wchar_t **argv UNUSED) + # endif { # ifdef FEAT_GUI SaveInst(hInstance); # endif ! VimMain(0, NULL); return 0; } *** ../vim-8.1.1103/src/version.c 2019-04-02 22:15:51.348273497 +0200 --- src/version.c 2019-04-03 20:27:55.890015117 +0200 *************** *** 773,774 **** --- 773,776 ---- { /* Add new patch number below this line */ + /**/ + 1104, /**/ -- hundred-and-one symptoms of being an internet addict: 186. You overstay in the office so you can have more time surfing the net. /// 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 ///