Mercurial > vim
changeset 16194:3a5114768cfa v8.1.1102
patch 8.1.1102: Win32 exe file contains unused code
commit https://github.com/vim/vim/commit/b26705afb55955306ffbe2a390e02fc052802b77
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Apr 2 22:02:32 2019 +0200
patch 8.1.1102: Win32 exe file contains unused code
Problem: Win32 exe file contains unused code.
Solution: Remove unused #ifdefs and code. (Ken Takata, closes https://github.com/vim/vim/issues/4198)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 02 Apr 2019 22:15:04 +0200 |
parents | 1f6f8e8da3c2 |
children | 4d55a37f8b1b |
files | src/os_w32exe.c src/version.c |
diffstat | 2 files changed, 13 insertions(+), 37 deletions(-) [+] |
line wrap: on
line diff
--- a/src/os_w32exe.c +++ b/src/os_w32exe.c @@ -10,7 +10,8 @@ /* * Windows GUI: main program (EXE) entry point: * - * Ron Aaron <ronaharon@yahoo.com> wrote this and the DLL support code. + * Ron Aaron <ronaharon@yahoo.com> wrote this and the (now deleted) DLL support + * code. */ #include "vim.h" @@ -20,54 +21,27 @@ # endif #endif -/* cproto doesn't create a prototype for main() */ -int _cdecl -#if defined(FEAT_GUI_MSWIN) -VimMain -#else - main +// cproto doesn't create a prototype for VimMain() +int _cdecl VimMain(int argc, char **argv); +#ifdef FEAT_GUI +void _cdecl SaveInst(HINSTANCE hInst); #endif - (int argc, char **argv); -static int (_cdecl *pmain)(int, char **); #ifndef PROTO -#ifdef FEAT_GUI -void _cdecl SaveInst(HINSTANCE hInst); -static void (_cdecl *pSaveInst)(HINSTANCE); -#endif - int WINAPI WinMain( - HINSTANCE hInstance UNUSED, + HINSTANCE hInstance, HINSTANCE hPrevInst UNUSED, LPSTR lpszCmdLine UNUSED, int nCmdShow UNUSED) { int argc = 0; char **argv = NULL; -#ifdef FEAT_GUI - pSaveInst = SaveInst; -#endif - pmain = -#if defined(FEAT_GUI_MSWIN) - //&& defined(__MINGW32__) - VimMain -#else - main -#endif - ; -#ifdef FEAT_GUI - pSaveInst( -#ifdef __MINGW32__ - GetModuleHandle(NULL) -#else - hInstance -#endif - ); -#endif - pmain(argc, argv); - free_cmd_argsW(); +# ifdef FEAT_GUI + SaveInst(hInstance); +# endif + VimMain(argc, argv); return 0; }