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

Re: Common header(s) for C and C++ API

From: Julian Foad <julianfoad_at_apache.org>
Date: Mon, 31 Dec 2018 14:43:15 +0000

I guess I'm missing something. Why not just move the existing C declarations verbatim to an APR-free header (from svn_types.h to svn_types_impl.h, for instance), and in C++ use them directly like this (proposed lines marked '>'):

   /**
    * @brief Revision number type.
    */
- enum class number : long
+ enum class number : svn__impl__revnum_t
> enum class number : svn_revnum_t
     {
- invalid = -1, ///< Invalid revision number.
+ invalid = SVN__IMPL__INVALID_REVNUM, ///< Invalid revision number.
> invalid = SVN_INVALID_REVNUM, ///< Invalid revision number.
     };

Then there would be no need for all the reimplementing in svn_types.h with lines like "A = __impl__A".

Oh... I suppose the reason is because you don't want the C++ headers to expose the original C declarations. But is that such a problem? I'm thinking of the existing SWIG Python bindings where we map C name svn_client_add to Python name "svn.client.add", primarily, but we also leave the original name hanging around as "svn.client.svn_client_add" or something like that, and AFAIK it's not much of a problem, just a little untidy.

Overall, if this is what it takes for you to proceed with the good work, then sure, go ahead: it looks like a manageable amount of churn.

-- 
- Julian
Received on 2018-12-31 15:43:22 CET

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.