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

Re: [libvirt] [libvirt-glib 1/2] Fix glib version check for g_type_init



Hey,

On Wed, Nov 14, 2012 at 03:45:00PM +0100, Michal Privoznik wrote:
> On 14.11.2012 15:16, Christophe Fergeau wrote:
> > g_type_init has been deprecated in glib 2.35, not 2.34. With versions
> > older than 2.35, we have to call it or we'll get a runtime failure.
> > ---
> >  libvirt-gconfig/libvirt-gconfig-compat.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libvirt-gconfig/libvirt-gconfig-compat.h b/libvirt-gconfig/libvirt-gconfig-compat.h
> > index 85a420d..3719896 100644
> > --- a/libvirt-gconfig/libvirt-gconfig-compat.h
> > +++ b/libvirt-gconfig/libvirt-gconfig-compat.h
> > @@ -25,7 +25,7 @@
> >  
> >  #include <glib-object.h>
> >  
> > -#if GLIB_CHECK_VERSION(2, 34, 0)
> > +#if GLIB_CHECK_VERSION(2, 35, 0)
> >  #define g_type_init()
> >  #endif
> >  
> > 
> 
> Wasn't it deprecated in 2.36? From [1]:
> 
>   g_type_init has been deprecated since version 2.36 ...

2.35 is the development version for 2.36, so it has been deprecated
in the 2.35 release cycle, but the doc only mention 2.36 as this is when it
will get available. However, 2.36 is not released yet, but people using the
2.35 development version will hit the deprecation warning.

> Moreover, this is just a compile time check. Don't we want a runtime
> one? That is glib_check_version().

The deprecation warning happens at compile time, I don't think there's any
runtime warning when calling g_type_init().

Christophe

Attachment: pgpamIqNBiwcF.pgp
Description: PGP signature


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