Re: GThread struct now hidden



On Thu, 2011-11-24 at 10:01 +0100, Kjell Ahlstedt wrote:
> 2011-11-23 13:51, Murray Cumming skrev:
> >
> > Unfortunately, glibmm now does not build with --enable-warnings=fatal:
> >
> > template<class T>  inline
> > Private<T>::Private(typename Private<T>::DestructorFunc destructor_func)
> > {
> >   //TODO: This causes this warning:
> >   //extended initializer lists only available with -std=c++0x or -std=gnu
> > ++0x
> >   //See glib bug: https://bugzilla.gnome.org/show_bug.cgi?id=664618
> >   //We can work around this by building like so:
> >   //./configure --prefix=/opt/gnome30 'CXXFLAGS=-std=c++0x'
> >   gobject_ = G_PRIVATE_INIT(destructor_func);
> > }
> >
> #define G_PRIVATE_INIT(notify) { NULL, (notify), { NULL, NULL } }
> can be used for initialization, but it can't be used for assignment. 
> This version builds:
> 
> template <class T> inline
> Private<T>::Private(typename Private<T>::DestructorFunc destructor_func)
> {
>    GPrivate temp = G_PRIVATE_INIT(destructor_func);
>    gobject_ = temp;
> }
> 
> I similar trick is used in glib/glib/deprecated/gthread-deprecated.c, 
> function g_private_new().

Thanks. Please commit that, with an explanatory comment. A const before
GPrivate might be nice if that works.

-- 
murrayc murrayc com
www.murrayc.com
www.openismus.com



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