blob: efdbc96f75a38a5a683ae5a8c5a42cb44a8c68de [file] [log] [blame]
Bram Moolenaaredf3f972016-08-29 22:49:24 +02001/* vi:set ts=8 sts=4 sw=4 noet:
Bram Moolenaar071d4272004-06-13 20:20:40 +00002 *
3 * VIM - Vi IMproved by Bram Moolenaar
4 * GUI support by Robert Webb
5 *
6 * Do ":help uganda" in Vim to read copying and usage conditions.
7 * Do ":help credits" in Vim to see a list of people who contributed.
8 * See README.txt for an overview of the Vim source code.
9 */
10/*
11 * Windows GUI: main program (EXE) entry point:
12 *
Bram Moolenaarb26705a2019-04-02 22:02:32 +020013 * Ron Aaron <ronaharon@yahoo.com> wrote this and the (now deleted) DLL support
14 * code.
Bram Moolenaar071d4272004-06-13 20:20:40 +000015 */
16#include "vim.h"
17
18#ifdef __MINGW32__
19# ifndef _cdecl
20# define _cdecl
21# endif
22#endif
23
Bram Moolenaarb26705a2019-04-02 22:02:32 +020024// cproto doesn't create a prototype for VimMain()
Bram Moolenaarafde13b2019-04-28 19:46:49 +020025#ifdef VIMDLL
26__declspec(dllimport)
27#endif
Bram Moolenaarb26705a2019-04-02 22:02:32 +020028int _cdecl VimMain(int argc, char **argv);
Bram Moolenaarafde13b2019-04-28 19:46:49 +020029#ifndef VIMDLL
Bram Moolenaar071d4272004-06-13 20:20:40 +000030void _cdecl SaveInst(HINSTANCE hInst);
Bram Moolenaar071d4272004-06-13 20:20:40 +000031#endif
32
Bram Moolenaarb26705a2019-04-02 22:02:32 +020033#ifndef PROTO
Bram Moolenaar796cc422019-04-03 20:31:00 +020034# ifdef FEAT_GUI
Bram Moolenaar071d4272004-06-13 20:20:40 +000035 int WINAPI
Bram Moolenaar796cc422019-04-03 20:31:00 +020036wWinMain(
Bram Moolenaarb26705a2019-04-02 22:02:32 +020037 HINSTANCE hInstance,
Bram Moolenaar1266d672017-02-01 13:43:36 +010038 HINSTANCE hPrevInst UNUSED,
Bram Moolenaar796cc422019-04-03 20:31:00 +020039 LPWSTR lpszCmdLine UNUSED,
Bram Moolenaar1266d672017-02-01 13:43:36 +010040 int nCmdShow UNUSED)
Bram Moolenaar796cc422019-04-03 20:31:00 +020041# else
42 int
43wmain(int argc UNUSED, wchar_t **argv UNUSED)
44# endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000045{
Bram Moolenaarafde13b2019-04-28 19:46:49 +020046# ifndef VIMDLL
47# ifdef FEAT_GUI
Bram Moolenaarb26705a2019-04-02 22:02:32 +020048 SaveInst(hInstance);
Bram Moolenaarafde13b2019-04-28 19:46:49 +020049# else
50 SaveInst(GetModuleHandleW(NULL));
51# endif
Bram Moolenaarb26705a2019-04-02 22:02:32 +020052# endif
Bram Moolenaar796cc422019-04-03 20:31:00 +020053 VimMain(0, NULL);
Bram Moolenaar071d4272004-06-13 20:20:40 +000054
55 return 0;
56}
57#endif