[Spice-devel] [PATCHv2 win-agent 2/9] mingw: use standard main() entry function

Marc-André Lureau marcandre.lureau at gmail.com
Wed May 16 11:15:26 PDT 2012


---
 vdagent/vdagent.cpp     |    4 ++++
 vdservice/vdservice.cpp |    8 ++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/vdagent/vdagent.cpp b/vdagent/vdagent.cpp
index 5cbe222..2722741 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 __MINGW32__
+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..48ebd7b 100644
--- a/vdservice/vdservice.cpp
+++ b/vdservice/vdservice.cpp
@@ -1216,7 +1216,11 @@ void VDService::write_agent_control(uint32_t type, uint32_t opaque)
     }
 }
 
+#ifdef __MINGW32__
+int main(int argc, char* argv[])
+#else
 int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
+#endif
 {
     bool success = false;
 
@@ -1226,9 +1230,9 @@ int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
     }
     VDService* vdservice = VDService::get();
     if (argc > 1) {
-        if (lstrcmpi(argv[1], TEXT("install")) == 0) {
+        if (strcmp(argv[1], "install") == 0) {
             success = vdservice->install();
-        } else if (lstrcmpi(argv[1], TEXT("uninstall")) == 0) {
+        } else if (strcmp(argv[1], "uninstall") == 0) {
             success = vdservice->uninstall();
         } else {
             printf("Use: vdservice install / uninstall\n");
-- 
1.7.10.1



More information about the Spice-devel mailing list