[virt-tools-list] [PATCH v3 5/5] Drop old compatibility code

Eduardo Lima (Etrunko) etrunko at redhat.com
Fri Feb 12 11:35:53 UTC 2016


With glib requirements now being 2.38, these functions do not make sense anymore

Signed-off-by: Eduardo Lima (Etrunko) <etrunko at redhat.com>
---
 src/virt-glib-compat.c | 15 ---------------
 src/virt-glib-compat.h | 27 ---------------------------
 2 files changed, 42 deletions(-)

diff --git a/src/virt-glib-compat.c b/src/virt-glib-compat.c
index c15ff28..04d5c8c 100644
--- a/src/virt-glib-compat.c
+++ b/src/virt-glib-compat.c
@@ -17,18 +17,3 @@
 
 #include "virt-glib-compat.h"
 
-#if !GLIB_CHECK_VERSION(2,32,0)
-GByteArray *g_byte_array_new_take (guint8 *data, gsize len)
-{
-  GByteArray *array;
-
-  array = g_byte_array_new ();
-  g_assert (array->data == NULL);
-  g_assert (array->len == 0);
-
-  array->data = data;
-  array->len = len;
-
-  return array;
-}
-#endif
diff --git a/src/virt-glib-compat.h b/src/virt-glib-compat.h
index 1242289..23345a0 100644
--- a/src/virt-glib-compat.h
+++ b/src/virt-glib-compat.h
@@ -51,33 +51,6 @@ G_BEGIN_DECLS
   } G_STMT_END
 #endif
 
-#if !GLIB_CHECK_VERSION(2,28,0)
-#define g_clear_object(object_ptr) \
-  G_STMT_START {                                                             \
-    /* Only one access, please */                                            \
-    gpointer *_p = (gpointer) (object_ptr);                                  \
-    gpointer _o;                                                             \
-                                                                             \
-    do                                                                       \
-      _o = g_atomic_pointer_get (_p);                                        \
-    while G_UNLIKELY (!g_atomic_pointer_compare_and_exchange (_p, _o, NULL));\
-                                                                             \
-    if (_o)                                                                  \
-      g_object_unref (_o);                                                   \
-  } G_STMT_END
-#endif
-
-#if !GLIB_CHECK_VERSION(2,32,0)
-GByteArray *g_byte_array_new_take (guint8 *data, gsize len);
-
-#define G_SOURCE_CONTINUE   TRUE
-#define G_SOURCE_REMOVE     FALSE
-#endif
-
-#if GLIB_CHECK_VERSION(2,31,0)
-#define g_mutex_new() g_new0(GMutex, 1)
-#endif
-
 G_END_DECLS
 
 #endif // _VIRT_GLIB_COMPAT_H
-- 
2.5.0




More information about the virt-tools-list mailing list