]> git.street.me.uk Git - andy/viking.git/blobdiff - src/googlesearch.c
[QA] Tidy up preferences.c
[andy/viking.git] / src / googlesearch.c
index 67c113087678540cbdd7f7f8d6184b1da5e190e3..a175ccf96de72e2490c536ff894d0f68a0bf09dc 100644 (file)
 
 #include "googlesearch.h"
 
+/* Compatibility */
+#if ! GLIB_CHECK_VERSION(2,22,0)
+#define g_mapped_file_unref g_mapped_file_free
+#endif
+
 #define GOOGLE_GOTO_URL_FMT "http://maps.google.com/maps?q=%s&output=js"
 #define GOOGLE_GOTO_PATTERN_1 "{center:{lat:"
 #define GOOGLE_GOTO_PATTERN_2 ",lng:"
@@ -143,7 +148,7 @@ static gboolean google_goto_tool_parse_file_for_latlon(VikGotoTool *self, gchar
   ll->lon = g_ascii_strtod(lon_buf, NULL);
 
 done:
-  g_mapped_file_free(mf);
+  g_mapped_file_unref(mf);
   return (found);
 
 }