Re: SPI-header-files safe for C++-compiler - Mailing list pgsql-patches

From Neil Conway
Subject Re: SPI-header-files safe for C++-compiler
Date
Msg-id 1182991066.26843.21.camel@dell.linuxdev.us.dell.com
Whole thread Raw
In response to SPI-header-files safe for C++-compiler  (Jacob Rief <jacob.rief@gmx.at>)
Responses Re: SPI-header-files safe for C++-compiler  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-patches
On Thu, 2007-06-28 at 00:43 +0200, Jacob Rief wrote:
> But the C++-compiler rejects to compile legal C code,
> because some of the included Postgres-headers, ie. postgres.h,
> executor/spi.h, commands/trigger.h, fmgr.h use a few C++ keywords to
> defined a some struct members and function arguments. The incriminating
> C++-keywords used in the Postgres-headers are: 'typeid', 'typename' and
> 'using'.
>
> It would do no harm to the Postgres-sources if these keywords would be
> replaced with a similar identifier.

No objection, although it would be nice if we could find something nicer
to rename "using" to than "using_". What about "using_clause" or
"using_list"?

You also changed "namespace" => "name_space" in builtins.h; is that
necessary?

> I wrote a patch which applies cleanly onto version 8.2.4

Patches should be submitted against the CVS HEAD code: we wouldn't want
to apply a patch like this to the REL8_2_STABLE branch, in any case.

BTW, I notice the patch also adds 'extern "C" { ... }' statements to a
few random header files. Can't client programs do this before including
the headers, if necessary?

-Neil



pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Load Distributed Checkpoints, final patch
Next
From: Andrew Dunstan
Date:
Subject: Re: SPI-header-files safe for C++-compiler