code_app/sdk/webservice/main.cpp

37 lines
697 B
C++
Raw Normal View History

#include "base/HGDef.h"
#include "base/HGInc.h"
#include "base/HGThread.h"
2022-05-03 10:25:52 +00:00
#include "MsgLoop.h"
static void ThreadFunc(HGThread thread, HGPointer param)
{
(void)thread;
(void)param;
MsgLoop* loop = (MsgLoop*)param;
loop->Loop();
}
#if defined(HG_CMP_MSC)
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE iPrevInstance, LPWSTR lpCmdLine, int nCmdShow)
#else
int main()
#endif
{
#if defined(HG_CMP_MSC)
WSADATA ws = { 0 };
int ret = WSAStartup(MAKEWORD(2, 2), &ws);
assert(0 == ret);
#endif
MsgLoop loop;
HGThread thread = NULL;
HGBase_OpenThread(ThreadFunc, &loop, &thread);
HGBase_CloseThread(thread);
thread = NULL;
#if defined(HG_CMP_MSC)
WSACleanup();
#endif
return 0;
}