Re: server-side extension in c++

Поиск
Список
Период
Сортировка
От David Fetter
Тема Re: server-side extension in c++
Дата
Msg-id 20100602165502.GB1340@fetter.org
обсуждение исходный текст
Ответ на Re: server-side extension in c++  (Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>)
Ответы Re: server-side extension in c++  (Peter Geoghegan <peter.geoghegan86@gmail.com>)
Re: server-side extension in c++  (Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>)
Список pgsql-general
On Wed, Jun 02, 2010 at 05:41:10PM +0100, Mark Cave-Ayland wrote:
> David Fetter wrote:
>
> >Is PostGIS following these guidelines?
>
> In short, no. Due to various problems in the early days with C++
> exceptions generated by the GEOS library causing problems in C (and
> also ABI changes forcing a recompile of any GEOS linked library), a
> thin intermediate C++ layer called libgeos_c was added to GEOS.
>
> For each public C++ function, libgeos_c declares a similarly-named
> wrapper with extern "C" that just executes the underlying C++
> function. If an underlying error such as an exception occurs, the
> libgeos_c wrapper returns false, and a simple handler allows the C
> caller to retrieve the related error string.
>
> While it does seem quite inelegant, I don't believe any problems
> linking between C/C++ have been reported on any compiler/platform
> since this was  put into place.

It's good to have actual working code in production to bolster the
case that the design is sound.

How much work would it be to refactor libgeos_c to use a catch-all
exception handler?

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

В списке pgsql-general по дате отправления:

Предыдущее
От: Greg Smith
Дата:
Сообщение: Re: create index concurrently - duplicate index to reduce time without an index
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: Is it possible to make the order of output the same as the order of input parameters?