]> git.street.me.uk Git - andy/viking.git/commitdiff
Implement g_hash_table_remove_all in file.c too (for early glib versions)
authorEvan Battaglia <gtoevan@gmx.net>
Tue, 9 Oct 2007 20:53:01 +0000 (20:53 +0000)
committerEvan Battaglia <gtoevan@gmx.net>
Tue, 9 Oct 2007 20:53:01 +0000 (20:53 +0000)
src/file.c

index b1fd3b40fcd76573404eb82887783c7d6bcd6173..80d2a95d2f4d8db61c32260069d5f44a2a99490f 100644 (file)
 #include <glib.h>
 #include <glib/gstdio.h>
 
+/* Relax some dependencies */
+#if ! GLIB_CHECK_VERSION(2,12,0)
+static gboolean return_true (gpointer a, gpointer b, gpointer c) { return TRUE; }
+static g_hash_table_remove_all (GHashTable *ght) { g_hash_table_foreach_remove ( ght, (GHRFunc) return_true, FALSE ); }
+#endif
+
 #define TEST_BOOLEAN(str) (! ((str)[0] == '\0' || (str)[0] == '0' || (str)[0] == 'n' || (str)[0] == 'N' || (str)[0] == 'f' || (str)[0] == 'F') )
 #define VIK_MAGIC "#VIK"
 #define GPX_MAGIC "<?xm"