[geos-devel] Thread safe error handling

Sandro Santilli strk at keybit.net
Mon Sep 9 06:14:45 PDT 2013

On Mon, Sep 09, 2013 at 01:41:24PM +0200, Pepijn Van Eeckhoudt wrote:

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

You will always send 2 arguments to the user-provided old function, so
you don't have to care about varargs at that point.

You would just call

   user_provided_notifier("%s", the_printed_buffer_pointer)

IFF no new handler was registered in the context.

Actually, the new notifier may even stop being a varargs, at this point,
allowing for something like:

  if ( new_handler ) {
    new_handler(user_data, message_buffer);
  } else {
    old_handler("%s", message_buffer);


More information about the geos-devel mailing list