Re: [gtk-vnc-devel] [patch] versions
- From: "Daniel P. Berrange" <berrange redhat com>
- To: Jonh Wendell <jwendell gnome org>
- Cc: gtk-vnc-devel List <gtk-vnc-devel lists sourceforge net>
- Subject: Re: [gtk-vnc-devel] [patch] versions
- Date: Sun, 20 Jan 2008 17:06:17 +0000
On Sun, Jan 20, 2008 at 02:02:04PM -0300, Jonh Wendell wrote:
> Hi, gang!
>
> Due to vinagre get into GNOME 2.22 Desktop, I need to be more careful
> when using gtk-vnc trunk.
>
> For example, I'm using the new function
> vnc_display_set_lossy_encoding(), available only in trunk. This has
> caused some issues on people trying to build vinagre from trunk.
>
> In order to fix this, I created a file vncversion.h.in, similar to
> gtkversion.h.in, which we can test if we're compiling against a specific
> version of gtk-vnc.
>
> In this case, I could just put in vinagre:
> #if VNC_CHECK_VERSION(0, 3, 3)
> vnc_display_set_lossy_encoding (VNC_DISPLAY(tab->priv->vnc), TRUE);
> #endif
>
> What do you think about this approach? OK to commit? comments?
Doing checks based on version numbers is a really bad idea IMHO. The
better approach is to check for the actual function in autoconf.
eg in your configure.in add
old_LIBS="$LIBS"
LIBS="$LIBS $GTK_VNC_LDFLAGS"
AC_CHECK_FUNC(vnc_display_set_lossy_encoding)
LIBS="$old_LIBS"
Then in your code you'll be able todo
#if HAVE_VNC_DISPLAY_SET_LOSSY_ENCODING
....
#endif
NB, make sure you include 'config.h' in all your files
Alternatively don't make use of new symbols from unreleased GTK-VNC
code in the trunk for vinagre. Keep it on a branch off the trunk until
the GTK-VNC release is done - since we release once a month this isn't
too much hassle - and it saves cluttering up the vinagre code with lots
of #if blocks.
Regards,
Dan.
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
|=- Perl modules: http://search.cpan.org/~danberr/ -=|
|=- Projects: http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]