blob: 769a85191ca2e93c7ee2187df677571d24100fd3 [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()
25int _cdecl VimMain(int argc, char **argv);
Bram Moolenaar071d4272004-06-13 20:20:40 +000026#ifdef FEAT_GUI
Bram Moolenaar071d4272004-06-13 20:20:40 +000027void _cdecl SaveInst(HINSTANCE hInst);
Bram Moolenaar071d4272004-06-13 20:20:40 +000028#endif
29
Bram Moolenaarb26705a2019-04-02 22:02:32 +020030#ifndef PROTO
Bram Moolenaar796cc422019-04-03 20:31:00 +020031# ifdef FEAT_GUI
Bram Moolenaar071d4272004-06-13 20:20:40 +000032 int WINAPI
Bram Moolenaar796cc422019-04-03 20:31:00 +020033wWinMain(
Bram Moolenaarb26705a2019-04-02 22:02:32 +020034 HINSTANCE hInstance,
Bram Moolenaar1266d672017-02-01 13:43:36 +010035 HINSTANCE hPrevInst UNUSED,
Bram Moolenaar796cc422019-04-03 20:31:00 +020036 LPWSTR lpszCmdLine UNUSED,
Bram Moolenaar1266d672017-02-01 13:43:36 +010037 int nCmdShow UNUSED)
Bram Moolenaar796cc422019-04-03 20:31:00 +020038# else
39 int
40wmain(int argc UNUSED, wchar_t **argv UNUSED)
41# endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000042{
Bram Moolenaarb26705a2019-04-02 22:02:32 +020043# ifdef FEAT_GUI
44 SaveInst(hInstance);
45# endif
Bram Moolenaar796cc422019-04-03 20:31:00 +020046 VimMain(0, NULL);
Bram Moolenaar071d4272004-06-13 20:20:40 +000047
48 return 0;
49}
50#endif