r7397 - in mugshot-dependencies/trunk: glib/gobject libcroco/src



Author: otaylor
Date: 2008-03-26 16:11:47 -0500 (Wed, 26 Mar 2008)
New Revision: 7397

Modified:
   mugshot-dependencies/trunk/glib/gobject/glib-genmarshal.c
   mugshot-dependencies/trunk/libcroco/src/libcroco.h
Log:
glib-genmarshal.c: Hack to deal with issues with stdio on Windows
libcroco.h: Hack out include file that includes libxml headers

Modified: mugshot-dependencies/trunk/glib/gobject/glib-genmarshal.c
===================================================================
--- mugshot-dependencies/trunk/glib/gobject/glib-genmarshal.c	2008-03-26 14:27:24 UTC (rev 7396)
+++ mugshot-dependencies/trunk/glib/gobject/glib-genmarshal.c	2008-03-26 21:11:47 UTC (rev 7397)
@@ -35,6 +35,8 @@
 
 #ifdef G_OS_WIN32
 #include <io.h>
+/* HIPPO: Passing stdout to glib causes a crash */
+#define g_fprintf fprintf
 #endif
 
 /* --- defines --- */
@@ -652,11 +654,14 @@
   for (slist = files; slist; slist = slist->next)
     {
       gchar *file = slist->data;
-      gint fd = open (file, O_RDONLY);
-
-      if (fd < 0)
+      GError *error = NULL;
+      gchar *contents;
+      gsize length;
+      /* HIPPO: Passing a fd to libglib causes a crash */
+      if(!g_file_get_contents(file, &contents, &length, &error))
 	{
-	  g_warning ("failed to open \"%s\": %s", file, g_strerror (errno));
+	  g_warning ("failed to open \"%s\": %s", file, error->message);
+      g_error_free(error);
 	  result = 1;
 	  continue;
 	}
@@ -665,7 +670,7 @@
       scanner->input_name = file;
 
       /* parse & process file */
-      g_scanner_input_file (scanner, fd);
+      g_scanner_input_text (scanner, contents, length);
       
       /* scanning loop, we parse the input untill it's end is reached,
        * or our sub routine came across invalid syntax
@@ -724,7 +729,7 @@
 	}
       while (scanner->next_token != G_TOKEN_EOF);
 
-      close (fd);
+      g_free(contents);
     }
 
   /* put out trailer */

Modified: mugshot-dependencies/trunk/libcroco/src/libcroco.h
===================================================================
--- mugshot-dependencies/trunk/libcroco/src/libcroco.h	2008-03-26 14:27:24 UTC (rev 7396)
+++ mugshot-dependencies/trunk/libcroco/src/libcroco.h	2008-03-26 21:11:47 UTC (rev 7397)
@@ -37,7 +37,9 @@
 #include "cr-stylesheet.h"
 #include "cr-om-parser.h"
 #include "cr-prop-list.h"
+#if 0
 #include "cr-sel-eng.h"
+#endif
 #include "cr-style.h"
 #include "cr-string.h"
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]