[GSoC] GObjectification Summary
Tomasz Wasilczyk
twasilczyk at pidgin.im
Tue Nov 19 02:59:46 EST 2013
2013/11/19 Ankit Vani <a at nevitus.org>
> On Tue, Nov 19, 2013 at 12:27 PM, Tomasz Wasilczyk <twasilczyk at pidgin.im>
> wrote:
> > I'm not sure, if its revelant, but you can always use preprocessor
> > directives to write code both for currently required version and never
> ones.
> > You can even write your implementation of newer functions and put it into
> > glibcompat.h file.
>
> That would definitely work. I'll have to add this to glibcompat.h:
>
> #if !GLIB_CHECK_VERSION(2, 26, 0)
>
> static inline void g_object_notify_by_pspec(GObject *object, GParamSpec
> *pspec)
> {
> g_object_notify(object, g_param_spec_get_name(pspec));
> }
>
> #endif /* < 2.26.0 */
>
> However, I noticed this file is used sparingly at the moment. Is it okay
> to use
> it in every file that provides GObjects, even if they don't use anything
> else
> from the header?
>
It's pretty new, so it's not used widely yet. Feel free to use it where you
need it, as soon as it's not included in externally visible headers.
>
> Using g_object_notify_by_pspec() would avoid looking up a property name to
> retrieve its spec instance.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://pidgin.im/pipermail/devel/attachments/20131119/fb5a442a/attachment.html>
More information about the Devel
mailing list