aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-12-01 15:38:10 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-12-01 15:38:10 +0000
commite50ff44d757e06bf0c17f7bd6a7b834a3285d37d (patch)
treed90b265459a9d2a6d252624cb92e6dbb665923b4 /src
parentc73e9fc202f217a3c74103c27417c5243465a20f (diff)
downloadrspamd-e50ff44d757e06bf0c17f7bd6a7b834a3285d37d.tar.gz
rspamd-e50ff44d757e06bf0c17f7bd6a7b834a3285d37d.zip
Add support of g_int64 hash for old glib
Diffstat (limited to 'src')
-rw-r--r--src/libutil/util.c12
-rw-r--r--src/libutil/util.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/src/libutil/util.c b/src/libutil/util.c
index fee039c85..10b388977 100644
--- a/src/libutil/util.c
+++ b/src/libutil/util.c
@@ -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
diff --git a/src/libutil/util.h b/src/libutil/util.h
index c2e0f1605..ab1d205c1 100644
--- a/src/libutil/util.h
+++ b/src/libutil/util.h
@@ -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);