Re: Can I use extern "C" in an extension so I can use C++?

From: Isaac Morland <isaac(dot)morland(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Can I use extern "C" in an extension so I can use C++?
Date: 2020-07-06 00:47:08
Message-ID: CAMsGm5fvhKjfGMqPuJE2w+yFLP0QARGMV7JqxqbcHjG1LEUMQg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, 5 Jul 2020 at 18:49, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

>
> My example wrapped the Postgres #include's, the PG_MODULE_MAGIC call,
> and the PG_FUNCTION_INFO_V1 call(s) in extern "C" { ... }. I'm pretty
> sure you need to do all three of those things to get a working result
> without mangled external function names.
>

I wrapped my entire file - #includes and all - in extern "C" { ... } and it
worked perfectly. Thanks very much for your assistance and patience.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2020-07-06 00:53:50 Re: TAP tests and symlinks on Windows
Previous Message Michael Paquier 2020-07-06 00:36:35 Re: A patch for get origin from commit_ts.