[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: Bert Huijben <bert_at_qqmail.nl>
Date: Sun, 13 Feb 2011 21:28:00 +0100

> -----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.

        Bert
Received on 2011-02-13 21:28:52 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.