[geos-devel] Thread safe error handling

Pepijn Van Eeckhoudt pepijn at vaneeckhoudt.net
Mon Sep 9 06:08:50 PDT 2013

On ma, 2013-09-09 at 13:41 +0200, Pepijn Van Eeckhoudt wrote:
> > I'd pass "%s" as the 'fmt' arg, and a pointer to a geos-owned memory
> > space as the only argument. No client should be expecting anything
> > from those calls, except they'd be composed by a printf-like format
> > and a variable list of arguments which work fine with that format.
> I have to admit C++ is a very, very long time ago for me. Is it possible
> to call one variadic function from another one in C++? If not, how would
> you delegate from notice(handle,void*,fmt,...) (or the hypothetical
> method on a C++ class) to the current notice(fmt,...)? I think this is
> necessary to avoid breaking the ABI, no?

I went ahead and just coded this and things turned out just fine. Not
sure why I thought this was going to be a problem.

Patch in attachment. I tried to mimic the GEOS coding style as well as
possible. The function naming might need some work. The _r suffix
variants of init and set*Handler where already token so I've had to make
_r_v2 variants.

Patch is against svn trunk.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: ts_error_handling.patch
Type: text/x-patch
Size: 77297 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/geos-devel/attachments/20130909/fa39f405/attachment-0001.bin>

More information about the geos-devel mailing list