Re: PostgreSQL C Language Extension with C++ Code

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: TalGloz <glozmantal(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: PostgreSQL C Language Extension with C++ Code
Date: 2018-08-12 17:25:21
Message-ID: 27565.1534094721@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

TalGloz <glozmantal(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Igor Korot 2018-08-12 17:29:58 Re: PostgreSQL C Language Extension with C++ Code
Previous Message TalGloz 2018-08-12 17:05:38 PostgreSQL C Language Extension with C++ Code