Commit 1706e9d8 authored by Marc-André Lureau's avatar Marc-André Lureau Committed by Michael Tokarev
Browse files

win32: use glib gpoll if glib >= 2.50

A fix has been committed in upstream glib commit
210a9796f78eb90f76f1bd6a304e9fea05e97617.
(See also related bug https://bugzilla.gnome.org/show_bug.cgi?id=764415

)

It is desirable to use the glib version instead of qemu copy, since it
provides more debugging facilities (G_MAIN_POLL_DEBUG etc), and
hopefully has a better maintainance. Hopefully, we can drop the qemu
copy in a few years.

Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: default avatarDaniel P. Berrange <berrange@redhat.com>
Reviewed-by: default avatarStefan Weil <sw@weilnetz.de>
Signed-off-by: default avatarMichael Tokarev <mjt@tls.msk.ru>
parent 6e4c890e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ static inline gint64 qemu_g_get_monotonic_time(void)
#define g_get_monotonic_time() qemu_g_get_monotonic_time()
#endif

#ifdef _WIN32
#if defined(_WIN32) && !GLIB_CHECK_VERSION(2, 50, 0)
/*
 * g_poll has a problem on Windows when using
 * timeouts < 10ms, so use wrapper.
+2 −0
Original line number Diff line number Diff line
@@ -327,6 +327,7 @@ char *qemu_get_exec_dir(void)
    return g_strdup(exec_dir);
}

#if !GLIB_CHECK_VERSION(2, 50, 0)
/*
 * The original implementation of g_poll from glib has a problem on Windows
 * when using timeouts < 10 ms.
@@ -530,6 +531,7 @@ gint g_poll(GPollFD *fds, guint nfds, gint timeout)

    return retval;
}
#endif

int getpagesize(void)
{