From 86571e9448cb28ed67cc3b995d788dd744d6022c Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Sun, 29 Mar 2015 23:47:45 +0100 Subject: [PATCH] Fix potential broken builds. Annoyingly g_str_to_ascii() is actually a recent addition to GLIB, despite the manual not stating which version it is available in (hence I thought it was always available). --- src/thumbnails.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/thumbnails.c b/src/thumbnails.c index 479239268..685ae6acc 100644 --- a/src/thumbnails.c +++ b/src/thumbnails.c @@ -204,7 +204,13 @@ static GdkPixbuf *save_thumbnail(const char *pathname, GdkPixbuf *full) // Thumb::URI must be in ISO-8859-1 encoding otherwise gdk_pixbuf_save() will fail // - e.g. if characters such as 'ě' are encountered // Also see http://en.wikipedia.org/wiki/ISO/IEC_8859-1 + // ATM GLIB Manual doesn't specify in which version this function became available + // find out that it's fairly recent so may break builds without this test +#if GLIB_CHECK_VERSION(2,40,0) char *thumb_uri = g_str_to_ascii ( uri, NULL ); +#else + char *thumb_uri = g_strdup ( uri ); +#endif old_mask = umask(0077); GError *error = NULL; gdk_pixbuf_save(thumb, to->str, "png", &error,