提交 f95c967a 编写于 作者: S Stefan Hajnoczi 提交者: Michael Tokarev

glib: move g_poll() replacement into glib-compat.h

We have a dedicated header file for wrappers to smooth over glib version
differences.  Move the g_poll() definition into glib-compat.h for
consistency.
Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
Cc: qemu-trivial@nongnu.org
上级 f33cc84d
......@@ -24,4 +24,16 @@ static inline guint g_timeout_add_seconds(guint interval, GSourceFunc function,
}
#endif
#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
#endif
......@@ -124,18 +124,6 @@ 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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册