summaryrefslogtreecommitdiff
path: root/vdservice
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2012-05-10 23:43:59 +0200
committerMarc-André Lureau <marcandre.lureau@gmail.com>2012-05-24 13:53:43 +0200
commitb4b7105c572d50952ae132b722fb59ffce709bb2 (patch)
treed9a6b3eca885ccb4a27b540cb556f6f93062b8d8 /vdservice
parent1a7ad7ab1f8a0aedffb4060ff41ae98393584165 (diff)
mingw: add standard main() entry function
Thanks Paolo for the suggestion: http://lists.freedesktop.org/archives/spice-devel/2012-May/009291.html
Diffstat (limited to 'vdservice')
-rw-r--r--vdservice/vdservice.cpp17
1 files changed, 16 insertions, 1 deletions
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;