Craig Ringer <craig@postnewspapers.com.au> writes:
> There's lots more information about this on the Internet. Just look for
> generic resources on calling C from C++ and vice versa.
> (I don't *think* there are any issues with libstdc++, though you'd
> probably have to make sure that no other program linked into Pg brings
> in a different version of libstdc++.)
I believe this is fairly platform-dependent. On platforms where the
standard libc includes everything you need for C++, you'd likely be okay,
but we've seen problems on (possibly obsolete?) platforms where it
doesn't. One thing you've got to be really wary of is C++ exceptions,
which tend not to interoperate nicely with PG's longjmp-based error
handling.
My own advice is to think twice about how badly your function needs to
be C++ rather than plain C.
regards, tom lane