Skip to content

Commit

Permalink
Fix potential broken builds.
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
rnorris committed Mar 29, 2015
1 parent c164842 commit 86571e9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/thumbnails.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 86571e9

Please sign in to comment.