Fix test compilation with older glibs.
authorZoltan Varga <vargaz@gmail.com>
Fri, 22 Oct 2010 07:28:20 +0000 (09:28 +0200)
committerZoltan Varga <vargaz@gmail.com>
Fri, 22 Oct 2010 07:28:47 +0000 (09:28 +0200)
eglib/test/hashtable.c

index 5215a53bd029a598e827b83aa4bbd35410933370..8eb98852fd161ff7b457cec2a120c1845a4661e1 100644 (file)
@@ -133,6 +133,7 @@ RESULT hash_grow (void)
 
 RESULT hash_iter (void)
 {
+#if !defined(GLIB_MAJOR_VERSION) || GLIB_CHECK_VERSION(2, 16, 0)
        GHashTable *hash = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, NULL);
        GHashTableIter iter;
        int i, sum, keys_sum, values_sum;
@@ -156,6 +157,10 @@ RESULT hash_iter (void)
                return FAILED ("Did not find all key-value pairs");
        g_hash_table_destroy (hash);
        return NULL;
+#else
+       /* GHashTableIter was added in glib 2.16 */
+       return NULL;
+#endif
 }
 
 static Test hashtable_tests [] = {