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