gdk-pixbuf portability patch again



here's the next iteration of my gdk-pixbuf patch.
Hopefuly this one is acceptable now. If removed all
the XPM save buisiness and provide a ChageLog entry again:

2000-11-11  Hans Breuer <Hans Breuer Org>

	* gdk-pixbuf-io.c : Fix all function prototype macros for self 
	contained image handlers (!USE_G_MODULE). Files to save should
	be opened in binary mode, fopen(s, "wb").

	* io-xpm.c : added HAVE_UNISTD_H condition

(the g_mkstemp issue has been fixed by Tor recently) 

Would it be ok to apply these changes to cvs now ?

	Hans
diff --exclude-from=c:\util\tool\diff.ign -u -r from-cvs/gtk+/gdk-pixbuf/ChangeLog my-gtk/gtk+/gdk-pixbuf/ChangeLog
--- from-cvs/gtk+/gdk-pixbuf/ChangeLog	Sat Nov 11 21:34:08 2000
+++ my-gtk/gtk+/gdk-pixbuf/ChangeLog	Sat Nov 11 23:04:44 2000
@@ -1,3 +1,11 @@
+2000-11-11  Hans Breuer <Hans Breuer Org>
+
+	* gdk-pixbuf-io.c : Fix all function prototype macros for self 
+	contained image handlers (!USE_G_MODULE). Files to save should
+	be opened in binary mode, fopen(s, "wb").
+
+	* io-xpm.c : added HAVE_UNISTD_H condition
+
 2000-11-11  Tor Lillqvist  <tml iki fi>
 
 	* gdk_pixbuf.def: Add gdk_pixbuf_new_subpixbuf.
diff --exclude-from=c:\util\tool\diff.ign -u -r from-cvs/gtk+/gdk-pixbuf/gdk-pixbuf-io.c my-gtk/gtk+/gdk-pixbuf/gdk-pixbuf-io.c
--- from-cvs/gtk+/gdk-pixbuf/gdk-pixbuf-io.c	Sun Oct 22 20:14:16 2000
+++ my-gtk/gtk+/gdk-pixbuf/gdk-pixbuf-io.c	Tue Oct 31 23:02:58 2000
@@ -349,17 +349,18 @@
 #else
 
 #define mname(type,fn) gdk_pixbuf__ ## type ## _image_ ##fn
-#define m_load(type)  extern GdkPixbuf * mname(type,load) (FILE *f);
+#define m_load(type)  extern GdkPixbuf * mname(type,load) (FILE *f, GError **error);
 #define m_load_xpm_data(type)  extern GdkPixbuf * mname(type,load_xpm_data) (const char **data);
 #define m_begin_load(type)  \
    extern gpointer mname(type,begin_load) (ModulePreparedNotifyFunc prepare_func, \
 				 ModuleUpdatedNotifyFunc update_func, \
 				 ModuleFrameDoneNotifyFunc frame_done_func,\
 				 ModuleAnimationDoneNotifyFunc anim_done_func,\
-				 gpointer user_data);
+				 gpointer user_data,\
+				 GError **error);
 #define m_stop_load(type)  extern void mname(type,stop_load) (gpointer context);
-#define m_load_increment(type)  extern gboolean mname(type,load_increment) (gpointer context, const guchar *buf, guint size);
-#define m_load_animation(type)  extern GdkPixbufAnimation * mname(type,load_animation) (FILE *f);
+#define m_load_increment(type)  extern gboolean mname(type,load_increment) (gpointer context, const guchar *buf, guint size, GError **error);
+#define m_load_animation(type)  extern GdkPixbufAnimation * mname(type,load_animation) (FILE *f, GError **error);
 #define m_save(type) \
    extern gboolean mname(type,save) (FILE          *f, \
 				     GdkPixbuf     *pixbuf, \
@@ -857,7 +858,7 @@
         g_return_val_if_fail (filename != NULL, FALSE);
         g_return_val_if_fail (type != NULL, FALSE);
        
-        f = fopen (filename, "w");
+        f = fopen (filename, "wb");
         
         if (f == NULL) {
                 g_set_error (error,
Only in my-gtk/gtk+/gdk-pixbuf: gdk-pixbuf.def
diff --exclude-from=c:\util\tool\diff.ign -u -r from-cvs/gtk+/gdk-pixbuf/io-xpm.c my-gtk/gtk+/gdk-pixbuf/io-xpm.c
--- from-cvs/gtk+/gdk-pixbuf/io-xpm.c	Sat Nov 11 21:34:08 2000
+++ my-gtk/gtk+/gdk-pixbuf/io-xpm.c	Sat Nov 11 23:03:34 2000
@@ -27,7 +27,9 @@
 #include <stdlib.h>
 #include <string.h>
 #include <glib.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include "gdk-pixbuf-private.h"
 #include "gdk-pixbuf-io.h"

-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to 
get along without it.                -- Dilbert


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