aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--epan/register.c1
-rw-r--r--wsutil/glib-compat.c19
-rw-r--r--wsutil/glib-compat.h4
3 files changed, 24 insertions, 0 deletions
diff --git a/epan/register.c b/epan/register.c
index 63973c684a..877f7ff223 100644
--- a/epan/register.c
+++ b/epan/register.c
@@ -12,6 +12,7 @@
#include "ws_attributes.h"
#include <glib.h>
+#include <wsutil/glib-compat.h>
#include "epan/dissectors/dissectors.h"
static const char *cur_cb_name = NULL;
diff --git a/wsutil/glib-compat.c b/wsutil/glib-compat.c
index 4691a5576f..7dd67d16a7 100644
--- a/wsutil/glib-compat.c
+++ b/wsutil/glib-compat.c
@@ -110,6 +110,25 @@ g_ptr_array_new_full(guint reserved_size,
}
#endif /* GLIB_CHECK_VERSION(2, 30, 0)*/
+#if !GLIB_CHECK_VERSION(2,31,18)
+/**
+Code copied from dumpcap.c
+*/
+gpointer
+g_async_queue_timeout_pop(GAsyncQueue *queue,
+ guint64 timeout)
+{
+ GTimeVal wait_time;
+ gpointer q_status;
+
+ g_get_current_time(&wait_time);
+ g_time_val_add(&wait_time, timeout);
+ q_status = g_async_queue_timed_pop(queue, &wait_time);
+
+ return q_status;
+}
+
+#endif /* GLIB_CHECK_VERSION(2,31,18)*/
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
diff --git a/wsutil/glib-compat.h b/wsutil/glib-compat.h
index 54632e8ab3..1acf587c19 100644
--- a/wsutil/glib-compat.h
+++ b/wsutil/glib-compat.h
@@ -34,4 +34,8 @@ WS_DLL_PUBLIC gint64 g_get_monotonic_time (void);
WS_DLL_PUBLIC GPtrArray* g_ptr_array_new_full(guint reserved_size, GDestroyNotify element_free_func);
#endif /* !GLIB_CHECK_VERSION(2, 30, 0) */
+#if !GLIB_CHECK_VERSION(2,31,18)
+WS_DLL_PUBLIC gpointer g_async_queue_timeout_pop(GAsyncQueue *queue, guint64 timeout);
+#endif /* !GLIB_CHECK_VERSION(2,31,18) */
+
#endif /* GLIB_COMPAT_H */