]> Pileus Git - ~andy/gtk/commitdiff
gtk-demo: Find gtk-demo-application.exe on win32
authorAlexander Larsson <alexl@redhat.com>
Fri, 20 Apr 2012 14:00:48 +0000 (16:00 +0200)
committerAlexander Larsson <alexl@redhat.com>
Fri, 20 Apr 2012 14:00:48 +0000 (16:00 +0200)
We need to append the ".exe" extension when looking for the
application file on windows.

demos/gtk-demo/application.c

index 6b9d07416814851783a8407da3d1075f4bd05bd2..af4e4e487d8752ee96629b3e82b665f7b1b9b8fd 100644 (file)
@@ -427,6 +427,12 @@ on_name_vanished (GDBusConnection *connection,
     }
 }
 
+#ifdef G_OS_WIN32
+#define APP_EXTENSION ".exe"
+#else
+#define APP_EXTENSION
+#endif
+
 GtkWidget *
 do_application (GtkWidget *toplevel)
 {
@@ -445,8 +451,8 @@ do_application (GtkWidget *toplevel)
       const gchar *command;
       GError *error = NULL;
 
-      if (g_file_test ("./gtk3-demo-application", G_FILE_TEST_IS_EXECUTABLE))
-        command = "./gtk3-demo-application";
+      if (g_file_test ("./gtk3-demo-application" APP_EXTENSION, G_FILE_TEST_IS_EXECUTABLE))
+        command = "./gtk3-demo-application" APP_EXTENSION;
       else
         command = "gtk3-demo-application";