]> gitweb.factorcode.org Git - factor.git/blob - vm/main-windows-nt.cpp
Merge branch 'master' of git://factorcode.org/git/factor
[factor.git] / vm / main-windows-nt.cpp
1 #include "master.hpp"
2
3 int WINAPI WinMain(
4         HINSTANCE hInstance,
5         HINSTANCE hPrevInstance,
6         LPSTR lpCmdLine,
7         int nCmdShow)
8 {
9         LPWSTR *szArglist;
10         int nArgs;
11
12         szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs);
13         if(NULL == szArglist)
14         {
15                 puts("CommandLineToArgvW failed");
16                 return 1;
17         }
18
19         factor::init_globals();
20   #ifdef FACTOR_MULTITHREADED
21         factor::THREADHANDLE thread = factor::start_standalone_factor_in_new_thread(nArgs,szArglist);
22         WaitForSingleObject(thread, INFINITE);
23   #else
24         factor::start_standalone_factor(nArgs,szArglist);
25   #endif
26
27         LocalFree(szArglist);
28
29         return 0;
30 }