Re: [Vala] Checking for methods



Won't work because of linking.

You could keep multiple .vapi inside your project for different versions and include separate files in your makefile. Since i don't think there are #ifdef in vala, you will need to have two files that consume the api as well, and choose which to use in your makefile.

if HAVE_FOOBAR
MY_VAPI += private-something-2.14
MY_VALASOURCES += consumer-2.14
else
MY_VAPI += private-something-2.10
MY_VALASOURCES += consumer-2.10
fi

Cheers

-- Christian

On Fri, Oct 31, 2008 at 12:35 PM, Federico Pelloni <federico pelloni gmail com> wrote:
Hi
In my app I'm using some new features from Gtk 2.14, but I don't want
to depend on such a recent release just for a couple of minor things,
so I'd like to use them only if available.
I'm wondering if there's a way to check if a class/namespace has a
method (e.g. I should check for Gtk namespace to contain "show_uri"
function), something similar to python "hasattr()".
Otherwise how could I do this check?
Could be useful considering that I'm using Waf to
configure/make/install my project.

Thank you

Regards,
Federico
_______________________________________________
Vala-list mailing list
Vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list



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