Re: Using C++ with CREATE FUNCTION

Поиск
Список
Период
Сортировка
От Mike Mascari
Тема Re: Using C++ with CREATE FUNCTION
Дата
Msg-id 3CFDAFDE.C844DC20@mascari.com
обсуждение исходный текст
Ответ на Using C++ with CREATE FUNCTION  (Mike Mascari <mascarm@mascari.com>)
Список pgsql-general
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 <string.h>
> #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
Дата:
Сообщение: Re: Postgres 7.2.1 Really Spinning the CPU
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: View vs. Statement Query Plan