Skip to contentSkip to conversation

configure: increase glib requirement to 2.22

PATCH Applied John Snow 4 participants 8 messages May 12, 2015 – May 22, 2015

lore
Share & tools
lore

John Snow

author
#0 lore raw

cover configure: increase glib requirement to 2.22

As discussed during the QEMU 2.3 development freeze.

==
For convenience, this branch is available at:
https://github.com/jnsnow/qemu.git branch glib-version-fix
https://github.com/jnsnow/qemu/tree/glib-version-fix

This version is tagged glib-version-fix-v1:
https://github.com/jnsnow/qemu/releases/tag/glib-version-fix-v1
==

John Snow (2):
configure: require glib 2.22
glib: remove stale compat functions

 configure             |  7 +------
 include/glib-compat.h | 35 -----------------------------------
 2 files changed, 1 insertion(+), 41 deletions(-)
Signature · 1 line
2.1.0
author
#1 lore raw

PATCH 1/2 configure: require glib 2.22

This provides g_ptr_array_new_with_free_func, as well as a few other functions that we've been hacking around in glib-compat.h. Cleaning up the compatibility headers will come later.

---
 configure | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
configure +1 -6
index 1f0f485..0c86eb2 100755
@@ -2773,12 +2773,7 @@ fi
 ##########################################
 # glib support probe
 
-if test "$mingw32" = yes; then
-    # g_poll is required in order to integrate with the glib main loop.
-    glib_req_ver=2.20
-else
-    glib_req_ver=2.12
-fi
+glib_req_ver=2.22
 glib_modules=gthread-2.0
 if test "$modules" = yes; then
     glib_modules="$glib_modules gmodule-2.0"
Signature · 1 line
2.1.0
author
#3 lore raw

PATCH 2/2 glib: remove stale compat functions

In reply to John Snow

Since we're bumping the version to 2.22+,
remove the now-stale compat functions.

---
 include/glib-compat.h | 35 -----------------------------------
 1 file changed, 35 deletions(-)
include/glib-compat.h +0 -35
index 28d9f15..318e000 100644
@@ -23,14 +23,6 @@
 #define G_TIME_SPAN_SECOND              (G_GINT64_CONSTANT(1000000))
 #endif
 
-#if !GLIB_CHECK_VERSION(2, 14, 0)
-static inline guint g_timeout_add_seconds(guint interval, GSourceFunc function,
-                                          gpointer data)
-{
-    return g_timeout_add(interval * 1000, function, data);
-}
-#endif
-
 #if !GLIB_CHECK_VERSION(2, 28, 0)
 static inline gint64 qemu_g_get_monotonic_time(void)
 {
@@ -47,23 +39,6 @@ static inline gint64 qemu_g_get_monotonic_time(void)
 #define g_get_monotonic_time() qemu_g_get_monotonic_time()
 #endif
 
-#if !GLIB_CHECK_VERSION(2, 16, 0)
-static inline int g_strcmp0(const char *str1, const char *str2)
-{
-    int result;
-
-    if (!str1) {
-        result = -(str1 != str2);
-    } else if (!str2) {
-        result = (str1 != str2);
-    } else {
-        result = strcmp(str1, str2);
-    }
-
-    return result;
-}
-#endif
-
 #ifdef _WIN32
 /*
  * g_poll has a problem on Windows when using
@@ -71,16 +46,6 @@ static inline int g_strcmp0(const char *str1, const char *str2)
  */
 #define g_poll(fds, nfds, timeout) g_poll_fixed(fds, nfds, timeout)
 gint g_poll_fixed(GPollFD *fds, guint nfds, gint timeout);
-#elif !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
 
 #if !GLIB_CHECK_VERSION(2, 31, 0)
Signature · 1 line
2.1.0
#6 lore raw
In reply to John Snow
Quoted 11 lines · John Snow

As discussed during the QEMU 2.3 development freeze.

==
For convenience, this branch is available at:
https://github.com/jnsnow/qemu.git branch glib-version-fix
https://github.com/jnsnow/qemu/tree/glib-version-fix

This version is tagged glib-version-fix-v1:
https://github.com/jnsnow/qemu/releases/tag/glib-version-fix-v1
==

Quoted 8 lines

John Snow (2):
configure: require glib 2.22
glib: remove stale compat functions

 configure             |  7 +------
 include/glib-compat.h | 35 -----------------------------------
 2 files changed, 1 insertion(+), 41 deletions(-)

Thanks, applied.

Paolo

author
#7 lore raw
Quoted 18 lines · Paolo Bonzini
Quoted 15 lines · John Snow

As discussed during the QEMU 2.3 development freeze.

==
For convenience, this branch is available at:
https://github.com/jnsnow/qemu.git branch glib-version-fix
https://github.com/jnsnow/qemu/tree/glib-version-fix

This version is tagged glib-version-fix-v1:
https://github.com/jnsnow/qemu/releases/tag/glib-version-fix-v1
==

John Snow (2):
configure: require glib 2.22
glib: remove stale compat functions

Quoted 9 lines
Quoted 4 lines
 configure             |  7 +------
 include/glib-compat.h | 35 -----------------------------------
 2 files changed, 1 insertion(+), 41 deletions(-)

Thanks, applied.

Paolo

As Paolo will be on PTO tomorrow and I am unappreciative and impatient, I will be stealing these patches back for the IDE tree to be sent today/tomorrow.

Thanks! :)

--js

Reviewed-by on v1 1/2
#2 lore raw

Re: [Qemu-devel] [PATCH 1/2] configure: require glib 2.22

In reply to John Snow
Quoted 6 lines · John Snow

This provides g_ptr_array_new_with_free_func, as well as a few other functions that we've been hacking around in glib-compat.h. Cleaning up the compatibility headers will come later.

Quoted 22 lines
---
 configure | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
configure +1 -6
index 1f0f485..0c86eb2 100755
@@ -2773,12 +2773,7 @@ fi
 ##########################################
 # glib support probe
 
-if test "$mingw32" = yes; then
-    # g_poll is required in order to integrate with the glib main loop.
-    glib_req_ver=2.20
-else
-    glib_req_ver=2.12
-fi
+glib_req_ver=2.22
 glib_modules=gthread-2.0
 if test "$modules" = yes; then
     glib_modules="$glib_modules gmodule-2.0"
Signature · 1 line
Alex Bennée
Reviewed-by on v1 2/2
#4 lore raw

Re: [Qemu-devel] [PATCH 2/2] glib: remove stale compat functions

In reply to John Snow
Quoted 4 lines · John Snow

Since we're bumping the version to 2.22+,
remove the now-stale compat functions.

Quoted 64 lines
---
 include/glib-compat.h | 35 -----------------------------------
 1 file changed, 35 deletions(-)
include/glib-compat.h +0 -35
index 28d9f15..318e000 100644
@@ -23,14 +23,6 @@
 #define G_TIME_SPAN_SECOND              (G_GINT64_CONSTANT(1000000))
 #endif
 
-#if !GLIB_CHECK_VERSION(2, 14, 0)
-static inline guint g_timeout_add_seconds(guint interval, GSourceFunc function,
-                                          gpointer data)
-{
-    return g_timeout_add(interval * 1000, function, data);
-}
-#endif
-
 #if !GLIB_CHECK_VERSION(2, 28, 0)
 static inline gint64 qemu_g_get_monotonic_time(void)
 {
@@ -47,23 +39,6 @@ static inline gint64 qemu_g_get_monotonic_time(void)
 #define g_get_monotonic_time() qemu_g_get_monotonic_time()
 #endif
 
-#if !GLIB_CHECK_VERSION(2, 16, 0)
-static inline int g_strcmp0(const char *str1, const char *str2)
-{
-    int result;
-
-    if (!str1) {
-        result = -(str1 != str2);
-    } else if (!str2) {
-        result = (str1 != str2);
-    } else {
-        result = strcmp(str1, str2);
-    }
-
-    return result;
-}
-#endif
-
 #ifdef _WIN32
 /*
  * g_poll has a problem on Windows when using
@@ -71,16 +46,6 @@ static inline int g_strcmp0(const char *str1, const char *str2)
  */
 #define g_poll(fds, nfds, timeout) g_poll_fixed(fds, nfds, timeout)
 gint g_poll_fixed(GPollFD *fds, guint nfds, gint timeout);
-#elif !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
 
 #if !GLIB_CHECK_VERSION(2, 31, 0)
Signature · 1 line
Alex Bennée