[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Proposal: Add #define to show new API element is available

From: <kfogel_at_collab.net>
Date: 2005-04-04 18:19:48 CEST

Barry Scott <barry@barrys-emacs.org> writes:
> I've just been adding code to deal with detecting new API functions.
> I've ended up with code like this:
>
> #if (SVN_VER_MAJOR == 1 && SVN_VER_MINOR >= 1) || SVN_VER_MAJOR > 1
> #define PYSVN_HAS_CLIENT_ADD2
> #define PYSVN_HAS_CLIENT_EXPORT2
> #endif
>
> #if (SVN_VER_MAJOR == 1 && SVN_VER_MINOR >= 2) || SVN_VER_MAJOR > 1
> #define PYSVN_HAS_CLIENT_INFO
> #endif
>
> What would have made this all a lot easier is if the feature test
> macros where
> defined in the SVN headers.
>
> In svn_client.h how about having
>
> #define SVN_HAS_CLIENT_ADD2
>
> Then code that builds on top of svn can test for features and avoid
> the version testing code.

It's already possible to test for the presence of an interface
(autoconf has ways to do this, for example, by attempting to compile a
small program which calls the interface, and detecting success for
failure). I think methods like that are the usual way to handle this
situation.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Apr 4 18:46:16 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.