]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Add support of g_int64 hash for old glib
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 1 Dec 2015 15:38:10 +0000 (15:38 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 1 Dec 2015 15:38:10 +0000 (15:38 +0000)
src/libutil/util.c
src/libutil/util.h

index fee039c85f15a86dff286a7f9b4f49e53ea72132..10b3889777587b473931989cc58f383951207d37 100644 (file)
@@ -1327,6 +1327,18 @@ g_ptr_array_unref (GPtrArray *array)
 {
        g_ptr_array_free (array, TRUE);
 }
+gboolean
+g_int64_equal (gconstpointer v1, gconstpointer v2)
+{
+       return *((const gint64*) v1) == *((const gint64*) v2);
+}
+guint
+g_int64_hash (gconstpointer v)
+{
+       guint64 v64 = *(guint64 *)v;
+
+       return (guint) (v ^ (v >> 32));
+}
 #endif
 #if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION < 14))
 void
index c2e0f1605af4c061df1aed8554789d115ca7b774..ab1d205c10f51d4c11957cdb72b6fa9b326b8498 100644 (file)
@@ -177,6 +177,8 @@ void gperf_profiler_stop (void);
  */
 #if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION < 22))
 void g_ptr_array_unref (GPtrArray *array);
+gboolean g_int64_equal (gconstpointer v1, gconstpointer v2);
+guint g_int64_hash (gconstpointer v);
 #endif
 #if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION < 14))
 void g_queue_clear (GQueue *queue);