Mercurial > vim
comparison src/os_w32exe.c @ 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 | a246b020984c |
children | b0e19f135e50 |
comparison
equal
deleted
inserted
replaced
16193:1f6f8e8da3c2 | 16194:3a5114768cfa |
---|---|
8 * See README.txt for an overview of the Vim source code. | 8 * See README.txt for an overview of the Vim source code. |
9 */ | 9 */ |
10 /* | 10 /* |
11 * Windows GUI: main program (EXE) entry point: | 11 * Windows GUI: main program (EXE) entry point: |
12 * | 12 * |
13 * Ron Aaron <ronaharon@yahoo.com> wrote this and the DLL support code. | 13 * Ron Aaron <ronaharon@yahoo.com> wrote this and the (now deleted) DLL support |
14 * code. | |
14 */ | 15 */ |
15 #include "vim.h" | 16 #include "vim.h" |
16 | 17 |
17 #ifdef __MINGW32__ | 18 #ifdef __MINGW32__ |
18 # ifndef _cdecl | 19 # ifndef _cdecl |
19 # define _cdecl | 20 # define _cdecl |
20 # endif | 21 # endif |
21 #endif | 22 #endif |
22 | 23 |
23 /* cproto doesn't create a prototype for main() */ | 24 // cproto doesn't create a prototype for VimMain() |
24 int _cdecl | 25 int _cdecl VimMain(int argc, char **argv); |
25 #if defined(FEAT_GUI_MSWIN) | 26 #ifdef FEAT_GUI |
26 VimMain | 27 void _cdecl SaveInst(HINSTANCE hInst); |
27 #else | |
28 main | |
29 #endif | 28 #endif |
30 (int argc, char **argv); | |
31 static int (_cdecl *pmain)(int, char **); | |
32 | 29 |
33 #ifndef PROTO | 30 #ifndef PROTO |
34 #ifdef FEAT_GUI | |
35 void _cdecl SaveInst(HINSTANCE hInst); | |
36 static void (_cdecl *pSaveInst)(HINSTANCE); | |
37 #endif | |
38 | |
39 int WINAPI | 31 int WINAPI |
40 WinMain( | 32 WinMain( |
41 HINSTANCE hInstance UNUSED, | 33 HINSTANCE hInstance, |
42 HINSTANCE hPrevInst UNUSED, | 34 HINSTANCE hPrevInst UNUSED, |
43 LPSTR lpszCmdLine UNUSED, | 35 LPSTR lpszCmdLine UNUSED, |
44 int nCmdShow UNUSED) | 36 int nCmdShow UNUSED) |
45 { | 37 { |
46 int argc = 0; | 38 int argc = 0; |
47 char **argv = NULL; | 39 char **argv = NULL; |
48 #ifdef FEAT_GUI | |
49 pSaveInst = SaveInst; | |
50 #endif | |
51 pmain = | |
52 #if defined(FEAT_GUI_MSWIN) | |
53 //&& defined(__MINGW32__) | |
54 VimMain | |
55 #else | |
56 main | |
57 #endif | |
58 ; | |
59 #ifdef FEAT_GUI | |
60 pSaveInst( | |
61 #ifdef __MINGW32__ | |
62 GetModuleHandle(NULL) | |
63 #else | |
64 hInstance | |
65 #endif | |
66 ); | |
67 #endif | |
68 pmain(argc, argv); | |
69 | 40 |
70 free_cmd_argsW(); | 41 # ifdef FEAT_GUI |
42 SaveInst(hInstance); | |
43 # endif | |
44 VimMain(argc, argv); | |
71 | 45 |
72 return 0; | 46 return 0; |
73 } | 47 } |
74 #endif | 48 #endif |