]> gitweb.factorcode.org Git - factor.git/blob - vm/main-windows.cpp
xmode: fix handling of HASH_CHAR and always rules
[factor.git] / vm / main-windows.cpp
1 #include "master.hpp"
2
3 VM_C_API int wmain(int argc, wchar_t** argv) {
4   HANDLE proc = GetCurrentProcess();
5   HANDLE thread = GetCurrentThread();
6   BOOL res = DuplicateHandle(proc, thread, proc,
7                              &factor::boot_thread, GENERIC_ALL, FALSE, 0);
8   if (!res) {
9     factor::fatal_error("DuplicateHandle() failed", GetLastError());
10     return 1;
11   }
12   factor::init_mvm();
13   factor::start_standalone_factor(argc, argv);
14   return 0;
15 }
16
17 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
18                    LPSTR lpCmdLine, int nCmdShow) {
19   (void)hInstance;
20   (void)hPrevInstance;
21   (void)lpCmdLine;
22   (void)nCmdShow;
23   int argc;
24   wchar_t** argv = CommandLineToArgvW(GetCommandLine(), &argc);
25   wmain(argc, argv);
26
27   return 0;
28 }