]> git.proxmox.com Git - mirror_qemu.git/commitdiff
glib: move g_poll() replacement into glib-compat.h
authorStefan Hajnoczi <stefanha@redhat.com>
Fri, 2 May 2014 14:35:56 +0000 (18:35 +0400)
committerMichael Tokarev <mjt@tls.msk.ru>
Wed, 7 May 2014 17:00:43 +0000 (21:00 +0400)
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: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Cc: qemu-trivial@nongnu.org
include/glib-compat.h
include/qemu-common.h

index 8aa77afd6266c14e146113d8a0cb0ae06e808c21..8d259007009a8e66072b0b406bbaedc2c8339134 100644 (file)
@@ -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
index a998e8d36c85c2f0f33d1a60d8fc166f2ac510e5..3f3fd60f5b2c2773f1db59c61c79dabf5069c201 100644 (file)
@@ -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