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

Re: [PATCH] extend the SVN_ERR macro with a cleanup statement parameter

From: Branko Čibej <brane_at_e-reka.si>
Date: Sun, 13 Feb 2011 21:37:05 +0100

On 13.02.2011 21:28, Bert Huijben wrote:
>
>> -----Original Message-----
>> From: Danny Trebbien [mailto:dtrebbien_at_gmail.com]
>> Sent: zondag 13 februari 2011 21:00
>> To: Subversion Development
>> Subject: [PATCH] extend the SVN_ERR macro with a cleanup statement
>> parameter
>>
>> Attached is a small patch to extend the SVN_ERR macro with another
>> parameter, a cleanup statement, that is executed before the error
>> generated by EXPR (if not SVN_NO_ERROR) is returned. Also attached is
>> a log message.
>>
>> I plan on using this in a test of svn_subst_translate_string2() in
>> which I need to reset the locale to whatever it was before the test
>> began. See: http://thread.gmane.org/gmane.comp.version-
>> control.subversion.devel/125782
> It's much easier to use a helper function or (if that is impossible) a goto to get specialized error handling.
>
> This macro is in use everywhere inside Subversion and in many third party tools using our libraries so I would recommend to not change it.
>
> Another option is a file local macro that performs your specialized cleanup.
>
> All those options are used in multiple places in our codebase.

Just write your test as a wrapper around the real test functionality,
set and reset the locale in the wrapper and pass through whatever error
code you receive. Don't change the semantics of a public macro,
especialy not in a backwards-incompatible way.

-- Brane
Received on 2011-02-13 21:37:48 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.