Re: libnm-glib 0.9 depends on glib 2.28 now



On Mon, 2012-02-06 at 15:14 -0500, Dan Winship wrote:
> On 02/06/2012 11:45 AM, Dan Williams wrote:
> >> 'g_simple_async_result_take_error' was introduced with commit 9fd98ef9
> >> 'g_clear_object' was introduced with commit cc90f101
> >>
> >>
> >> Was this intended?
> > 
> > I think so
> 
> Actually, I meant to stick with the current glib requirements, I just
> forgot that take_error() was new-ish, and then the g_clear_object()
> slipped by without me noticing.
> 
> Patch attached. I made a compat macro for take_error, since it's useful,
> and just rewrote the one use of g_clear_object().
> 
> Oh, this is untested since I don't have a machine with old enough
> glib... Thomas, can you try it?

there was one piece missing - G_VALUE_INIT. Patch attached. Now NM
compiles with glib 2.24 (expect the gdbus example in examples/C/glib/
but i just comment that.)

Tom
>From 67a4580e1a28af309d3333ce511ddebc1fca3082 Mon Sep 17 00:00:00 2001
From: Thomas Bechtold <thomasbechtold jpberlin de>
Date: Tue, 7 Feb 2012 11:20:57 +0100
Subject: [PATCH] libnm-glib: fix missing G_VALUE_INIT to not depend on newer
 glib

---
 include/nm-glib-compat.h          |    5 +++++
 libnm-glib/nm-active-connection.c |    1 +
 libnm-glib/nm-device.c            |    1 +
 3 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/nm-glib-compat.h b/include/nm-glib-compat.h
index c404ca6..30b83e0 100644
--- a/include/nm-glib-compat.h
+++ b/include/nm-glib-compat.h
@@ -23,6 +23,7 @@
 #ifndef NM_GLIB_COMPAT_H
 #define NM_GLIB_COMPAT_H
 
+
 #include <glib.h>
 
 #if !GLIB_CHECK_VERSION(2,31,0)
@@ -30,6 +31,10 @@
 #define g_value_get_schar g_value_get_char
 #endif
 
+#if !GLIB_CHECK_VERSION(2,30,0)
+#define G_VALUE_INIT  { 0, { { 0 } } }
+#endif
+
 #if !GLIB_CHECK_VERSION(2,28,0)
 #define g_simple_async_result_take_error(result, error) \
 	G_STMT_START { \
diff --git a/libnm-glib/nm-active-connection.c b/libnm-glib/nm-active-connection.c
index 9c5be58..9002d84 100644
--- a/libnm-glib/nm-active-connection.c
+++ b/libnm-glib/nm-active-connection.c
@@ -31,6 +31,7 @@
 #include "nm-device-private.h"
 #include "nm-connection.h"
 #include "nm-vpn-connection.h"
+#include "nm-glib-compat.h"
 
 static GType nm_active_connection_type_for_path (DBusGConnection *connection,
                                                  const char *path);
diff --git a/libnm-glib/nm-device.c b/libnm-glib/nm-device.c
index 2a1e58f..408e912 100644
--- a/libnm-glib/nm-device.c
+++ b/libnm-glib/nm-device.c
@@ -38,6 +38,7 @@
 #include "nm-object-cache.h"
 #include "nm-marshal.h"
 #include "nm-dbus-glib-types.h"
+#include "nm-glib-compat.h"
 
 static GType nm_device_type_for_path (DBusGConnection *connection,
                                       const char *path);
-- 
1.7.8.3



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]