]> gitweb.factorcode.org Git - factor.git/blob - vm/main-windows-nt.cpp
cleaned up code a bit, added multithreaded mode flags
[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   #ifdef FACTOR_MULTITHREADED
20         factor::THREADHANDLE thread = factor::start_standalone_factor_in_new_thread(nArgs,szArglist);
21         WaitForSingleObject(thread, INFINITE);
22   #else
23         factor::start_standalone_factor(nArgs,szArglist);
24   #endif
25
26         LocalFree(szArglist);
27
28         return 0;
29 }