Re: #include <funcapi.h>

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Elliot Chance <elliotchance(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: #include <funcapi.h>
Date: 2010-12-26 06:14:45
Message-ID: 4D16DD55.90000@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On 12/26/2010 02:14 PM, Elliot Chance wrote:

> In file included from /usr/include/pgsql/server/access/heapam.h:21,
> from /usr/include/pgsql/server/nodes/execnodes.h:18,
> from /usr/include/pgsql/server/executor/execdesc.h:18,
> from /usr/include/pgsql/server/executor/executor.h:17,
> from /usr/include/pgsql/server/funcapi.h:21,
> from xapian.cpp:4:
> /usr/include/pgsql/server/nodes/primnodes.h:1155: error: expected unqualified-id before ‘using’

You've neglected to mention which version of Pg you're compiling
against, so that line number means nothing. What's the offending line of
code and the surrounding few lines in primnodes.h?

In any case, I think it's very likely the issue is a C/C++
incompatibility in the Pg headers. It fails for me in a different place
using Pg 9.1git and g++ 4.5, complaining about the use of "private" as
an identifier in fmgr.h, because it's a keyword in C++.

This is one of the many reasons you should keep any code that touches
the postgres innards as pure C, and call into your C++ code via "extern
C" functions. The Pg headers aren't really C++ safe. Neither is Pg's
longjmp-based error handling, which really won't mix well with
exceptions or with stack-based objects that have dtors.

--
Craig Ringer

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Elliot Chance 2010-12-26 08:20:33 Re: #include <funcapi.h>
Previous Message Elliot Chance 2010-12-26 03:14:40 #include <funcapi.h>

Browse pgsql-hackers by date

  From Date Subject
Next Message Elliot Chance 2010-12-26 08:20:33 Re: #include <funcapi.h>
Previous Message Robert Haas 2010-12-26 04:55:06 Re: [COMMITTERS] pgsql: Add foreign data wrapper error code values for SQL/MED.