[sgen] Fix logging of major heap size with concurrent sweep
[mono.git] / mono / mini / main.c
1 #include <config.h>
2 #include "mini.h"
3
4 #ifndef HOST_WIN32
5 #ifndef BUILDVER_INCLUDED
6 #include "buildver-boehm.h"
7 #endif
8 #endif
9
10 /*
11  * If the MONO_ENV_OPTIONS environment variable is set, it uses this as a
12  * source of command line arguments that are passed to Mono before the
13  * command line arguments specified in the command line.
14  */
15 static int
16 mono_main_with_options (int argc, char *argv [])
17 {
18         mono_parse_env_options (&argc, &argv);
19
20         return mono_main (argc, argv);
21 }
22
23 #ifdef HOST_WIN32
24
25 #include <shellapi.h>
26
27 int
28 main (void)
29 {
30         int argc;
31         gunichar2** argvw;
32         gchar** argv;
33         int i;
34
35         argvw = CommandLineToArgvW (GetCommandLine (), &argc);
36         argv = g_new0 (gchar*, argc + 1);
37         for (i = 0; i < argc; i++)
38                 argv [i] = g_utf16_to_utf8 (argvw [i], -1, NULL, NULL, NULL);
39         argv [argc] = NULL;
40
41         LocalFree (argvw);
42
43         return mono_main_with_options  (argc, argv);
44 }
45
46 #else
47
48 int
49 main (int argc, char* argv[])
50 {
51         mono_build_date = build_date;
52         
53         return mono_main_with_options (argc, argv);
54 }
55
56 #endif