From 1c5a5207fb2056b58be7a27a5135f39228702260 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 29 Jun 2015 15:48:08 +0100 Subject: [PATCH] fix glib resource API usage even when gresource was disabled --- gtk/resources.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gtk/resources.c b/gtk/resources.c index b90fdd49b..e2ca72eb5 100644 --- a/gtk/resources.c +++ b/gtk/resources.c @@ -468,7 +468,9 @@ nsgdk_pixbuf_new_from_resname(const char *resname, GdkPixbuf **pixbuf_out) break; case NSGTK_RESOURCE_GLIB: +#ifdef WITH_GRESOURCE new_pixbuf = gdk_pixbuf_new_from_resource(resource->path, &error); +#endif break; case NSGTK_RESOURCE_INLINE: @@ -540,6 +542,7 @@ nsgtk_data_from_resname(const char *resname, const uint8_t ** data_out, size_t *data_size_out) { +#ifdef WITH_GRESOURCE struct nsgtk_resource_s *resource; GBytes *data; const gchar *buffer; @@ -564,6 +567,12 @@ nsgtk_data_from_resname(const char *resname, *data_size_out = (size_t)buffer_length; return NSERROR_OK; +#else + /** \todo consider adding compiled inline resources for things + * other than pixbufs. + */ + return NSERROR_NOT_FOUND; +#endif } /* exported interface documented in gtk/resources.h */