Re: PostgreSQL C Language Extension with C++ Code - Mailing list pgsql-general

From Tom Lane
Subject Re: PostgreSQL C Language Extension with C++ Code
Date
Msg-id 27565.1534094721@sss.pgh.pa.us
Whole thread Raw
In response to PostgreSQL C Language Extension with C++ Code  (TalGloz <glozmantal@gmail.com>)
List pgsql-general
TalGloz <glozmantal@gmail.com> writes:
> I've searched information about my problem in the archives and on the
> internet, but it didn't help. I have this small myfunc.cpp
> [ that doesn't work ]

> 16: #ifdef PG_MODULE_MAGIC
> 17: PG_MODULE_MAGIC;
> 18: #endif

Hmm ... don't use an #ifdef there.  If you don't have the macro defined,
you want to fail, not silently build an extension without it.

It's possible you need extern "C" { ... } around the macro, too.

            regards, tom lane


pgsql-general by date:

Previous
From: TalGloz
Date:
Subject: PostgreSQL C Language Extension with C++ Code
Next
From: Igor Korot
Date:
Subject: Re: PostgreSQL C Language Extension with C++ Code