summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vdagent/vdagent.cpp4
-rw-r--r--vdservice/vdservice.cpp17
2 files changed, 20 insertions, 1 deletions
diff --git a/vdagent/vdagent.cpp b/vdagent/vdagent.cpp
index 5cbe222..9046476 100644
--- a/vdagent/vdagent.cpp
+++ b/vdagent/vdagent.cpp
@@ -1355,7 +1355,11 @@ LRESULT CALLBACK VDAgent::wnd_proc(HWND hwnd, UINT message, WPARAM wparam, LPARA
return 0;
}
+#ifdef __GNUC__
+int main(int argc,char **argv)
+#else
int APIENTRY _tWinMain(HINSTANCE instance, HINSTANCE prev_instance, LPTSTR cmd_line, int cmd_show)
+#endif
{
VDAgent* vdagent = VDAgent::get();
vdagent->run();
diff --git a/vdservice/vdservice.cpp b/vdservice/vdservice.cpp
index 4701f5a..9c5f569 100644
--- a/vdservice/vdservice.cpp
+++ b/vdservice/vdservice.cpp
@@ -1216,7 +1216,22 @@ void VDService::write_agent_control(uint32_t type, uint32_t opaque)
}
}
-int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
+#ifdef __GNUC__
+#undef _tmain
+#ifdef UNICODE
+int _tmain(int argc, TCHAR* argv[]);
+int main(void)
+{
+ int argc;
+ argv = CommandLineToArgvW(GetCommandLineW(), &argc);
+ return _tmain(argc, argv);
+}
+#else
+#define _tmain main
+#endif
+#endif
+
+int _tmain(int argc, TCHAR* argv[])
{
bool success = false;