I'm writing a client that uses the libsvn_client API, and in order to make the code as portable as possible, I have been using the minimum API version that has the features I need, which in my case is the 1.5 API. Unfortunately, that means using deprecated functions which spit out compiler warnings. I wanted to suggest using a preprocessor directive to target a codebase to a specific API version, something like the following:

#define USE_SVN_API 105
#include <svn_client.h>

I figure that could have two effects: first, it wouldn't set SVN_DEPRECATED for any functions current as of that API version, and second, it could use #pragma GCC poison [1] (or an equivalent for other compilers) to mark any functions introduced in a later version as compile errors.

Does that make sense? I could go through and write the patch, but I wanted to see if there was any buy-in from the community.

[1] http://gcc.gnu.org/onlinedocs/cpp/Pragmas.html

-Dani Church

Reply via email to