aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/qemu-common.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/qemu-common.h b/include/qemu-common.h
index 80016adae3..5e137084b5 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -142,6 +142,18 @@ int qemu_main(int argc, char **argv, char **envp);
void qemu_get_timedate(struct tm *tm, int offset);
int qemu_timedate_diff(struct tm *tm);
+#if !GLIB_CHECK_VERSION(2, 20, 0)
+/*
+ * Glib before 2.20.0 doesn't implement g_poll, so wrap it to compile properly
+ * on older systems.
+ */
+static inline gint g_poll(GPollFD *fds, guint nfds, gint timeout)
+{
+ GMainContext *ctx = g_main_context_default();
+ return g_main_context_get_poll_func(ctx)(fds, nfds, timeout);
+}
+#endif
+
/**
* is_help_option:
* @s: string to test