summaryrefslogtreecommitdiff
path: root/gdk-pixbuf
diff options
context:
space:
mode:
authorHans Breuer <hans@src.gnome.org>2000-11-12 15:58:18 +0000
committerHans Breuer <hans@src.gnome.org>2000-11-12 15:58:18 +0000
commit6bda7a895ea4115042cd0e8339ac0a3e23a6afd7 (patch)
treeb8705810916652d3855d23225c3264599d7fcf82 /gdk-pixbuf
parentaceeae34fb8c0e2d99b0e5c82c37232cfccc5c06 (diff)
downloadgtk+-6bda7a895ea4115042cd0e8339ac0a3e23a6afd7.tar.gz
portability fixes and corrected prototypes for self-contained build
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r--gdk-pixbuf/ChangeLog8
-rw-r--r--gdk-pixbuf/gdk-pixbuf-io.c11
-rw-r--r--gdk-pixbuf/io-xpm.c4
3 files changed, 17 insertions, 6 deletions
diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog
index 89c6d2436a..1355b8cf1e 100644
--- a/gdk-pixbuf/ChangeLog
+++ b/gdk-pixbuf/ChangeLog
@@ -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 --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c
index ad4c29924f..bd3bbba17e 100644
--- a/gdk-pixbuf/gdk-pixbuf-io.c
+++ b/gdk-pixbuf/gdk-pixbuf-io.c
@@ -349,17 +349,18 @@ gdk_pixbuf_load_module (GdkPixbufModule *image_module,
#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 @@ gdk_pixbuf_savev (GdkPixbuf *pixbuf,
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,
diff --git a/gdk-pixbuf/io-xpm.c b/gdk-pixbuf/io-xpm.c
index df561498f8..e813ae081c 100644
--- a/gdk-pixbuf/io-xpm.c
+++ b/gdk-pixbuf/io-xpm.c
@@ -27,7 +27,9 @@
#include <stdlib.h>
#include <string.h>
#include <glib.h>
-#include <unistd.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h> /* for unlink */
+#endif
#include "gdk-pixbuf-private.h"
#include "gdk-pixbuf-io.h"