Re: Using C++ with CREATE FUNCTION

Поиск
Список
Период
Сортировка
Искать
От
Mike Mascari
Тема
Re: Using C++ with CREATE FUNCTION
Дата
Msg-id
3CFDAFDE.C844DC20@mascari.com
Список
Дерево обсуждения
Re: Using C++ with CREATE FUNCTION Mike Mascari <mascarm@mascari.com>
I wrote:
> 
> I'm having a bit of trouble getting a shared module written in C++ to
> load correctly with CREATE FUNCTION. The C source is:
> 
> #include "postgres.h"
> #include 
> #include "fmgr.h"
> 
> PG_FUNCTION_INFO_V1(echo);

...

> 1. Prevent name mangling by adding:
> 
> extern "C" {
>   Datum echo(PG_FUNCTION_ARGS);
> };

Please ignore my post. The include directives must be within the extern
"C" block as well. I'm not sure what needs to be done - or if anything
should be - to allow "postgres.h" and "fmgr.h" to be __cplusplus aware,
but simply placing them within the extern "C" block solved all my
problems...

Mike Mascari
mascarm@mascari.com
В списке pgsql-general по дате отправления
От: Neil Conway
Дата:
От: Martijn van Oosterhout
Дата:
FAQ