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

[RFC] Preprocessor flags to target code to a specific API version

From: Dani Church <dchurch_at_cheri.shyou.org>
Date: Fri, 24 Sep 2010 15:04:17 -0400 (EDT)

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

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
Received on 2010-09-24 22:43:25 CEST

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