summaryrefslogtreecommitdiffstats
path: root/src/os_w32exe.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-04-28 19:46:49 +0200
committerBram Moolenaar <Bram@vim.org>2019-04-28 19:46:49 +0200
commitafde13b62b8fa25dac4635d5caee8d088b937ee0 (patch)
tree6a8b58aa58e180e55b2948e5d0bfdbc3d4692a49 /src/os_w32exe.c
parentab4cece6053b0bfd604e15065227b94af873608b (diff)
patch 8.1.1230: a lot of code is shared between vim.exe and gvim.exev8.1.1230
Problem: A lot of code is shared between vim.exe and gvim.exe. Solution: Optionally put the shared code in vim.dll. (Ken Takata, closes #4287)
Diffstat (limited to 'src/os_w32exe.c')
-rw-r--r--src/os_w32exe.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/os_w32exe.c b/src/os_w32exe.c
index 769a85191c..efdbc96f75 100644
--- a/src/os_w32exe.c
+++ b/src/os_w32exe.c
@@ -22,8 +22,11 @@
#endif
// cproto doesn't create a prototype for VimMain()
+#ifdef VIMDLL
+__declspec(dllimport)
+#endif
int _cdecl VimMain(int argc, char **argv);
-#ifdef FEAT_GUI
+#ifndef VIMDLL
void _cdecl SaveInst(HINSTANCE hInst);
#endif
@@ -40,8 +43,12 @@ wWinMain(
wmain(int argc UNUSED, wchar_t **argv UNUSED)
# endif
{
-# ifdef FEAT_GUI
+# ifndef VIMDLL
+# ifdef FEAT_GUI
SaveInst(hInstance);
+# else
+ SaveInst(GetModuleHandleW(NULL));
+# endif
# endif
VimMain(0, NULL);