Revision: 5940 http://geany.svn.sourceforge.net/geany/?rev=5940&view=rev Author: ntrel Date: 2011-09-21 13:47:37 +0000 (Wed, 21 Sep 2011) Log Message: ----------- Use #ifdef SYNC_SPAWN instead of G_OS_WIN32 for easier testing with glib's asynchronous spawning (currently doesn't work on Windows).
Modified Paths: -------------- branches/unstable/ChangeLog branches/unstable/src/build.c
Modified: branches/unstable/ChangeLog =================================================================== --- branches/unstable/ChangeLog 2011-09-21 13:43:23 UTC (rev 5939) +++ branches/unstable/ChangeLog 2011-09-21 13:47:37 UTC (rev 5940) @@ -1,3 +1,10 @@ +2011-09-21 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com> + + * src/build.c: + Use #ifdef SYNC_SPAWN instead of G_OS_WIN32 for easier testing with + glib's asynchronous spawning (currently doesn't work on Windows). + + 2011-09-20 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/keyfile.c:
Modified: branches/unstable/src/build.c =================================================================== --- branches/unstable/src/build.c 2011-09-21 13:43:23 UTC (rev 5939) +++ branches/unstable/src/build.c 2011-09-21 13:47:37 UTC (rev 5940) @@ -64,6 +64,11 @@ #include "toolbar.h" #include "geanymenubuttonaction.h"
+/* g_spawn_async_with_pipes doesn't work on Windows */ +#ifdef G_OS_WIN32 +#define SYNC_SPAWN +#endif + /* Number of editor indicators to draw - limited as this can affect performance */ #define GEANY_BUILD_ERR_HIGHLIGHT_MAX 50
@@ -116,7 +121,7 @@ static gint build_groups_count[GEANY_GBG_COUNT] = { 3, 4, 2 }; static gint build_items_count = 9;
-#ifndef G_OS_WIN32 +#ifndef SYNC_SPAWN static void build_exit_cb(GPid child_pid, gint status, gpointer user_data); static gboolean build_iofunc(GIOChannel *ioc, GIOCondition cond, gpointer data); #endif @@ -573,7 +578,7 @@ }
-#ifdef G_OS_WIN32 +#ifdef SYNC_SPAWN static void parse_build_output(const gchar **output, gint status) { guint x, i, len; @@ -592,7 +597,7 @@ { line = lines[i]; while (*line != '\0') - { /* replace any conrol characters in the output */ + { /* replace any control characters in the output */ if (*line < 32) *line = 32; line++; @@ -681,7 +686,7 @@ gchar *utf8_working_dir; gchar *cmd_string; gchar *utf8_cmd_string; -#ifdef G_OS_WIN32 +#ifdef SYNC_SPAWN gchar *output[2]; gint status; #else @@ -728,7 +733,7 @@ build_info.file_type_id = (doc == NULL) ? GEANY_FILETYPES_NONE : doc->file_type->id; build_info.message_count = 0;
-#ifdef G_OS_WIN32 +#ifdef SYNC_SPAWN if (! utils_spawn_sync(working_dir, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, &output[0], &output[1], &status, &error)) #else @@ -746,7 +751,7 @@ return (GPid) 0; }
-#ifdef G_OS_WIN32 +#ifdef SYNC_SPAWN parse_build_output((const gchar**) output, status); g_free(output[0]); g_free(output[1]); @@ -1028,7 +1033,7 @@ }
-#ifndef G_OS_WIN32 +#ifndef SYNC_SPAWN static gboolean build_iofunc(GIOChannel *ioc, GIOCondition cond, gpointer data) { if (cond & (G_IO_IN | G_IO_PRI)) @@ -1123,11 +1128,14 @@ }
-#ifndef G_OS_WIN32 +#ifndef SYNC_SPAWN static void build_exit_cb(GPid child_pid, gint status, gpointer user_data) { gboolean failure = FALSE;
+#ifdef G_OS_WIN32 + failure = status; +#else if (WIFEXITED(status)) { if (WEXITSTATUS(status) != EXIT_SUCCESS) @@ -1142,6 +1150,7 @@ { /* any other failure occured */ failure = TRUE; } +#endif show_build_result_message(failure);
utils_beep();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.