Re: SPI-header-files safe for C++-compiler
| От | Neil Conway |
|---|---|
| Тема | Re: SPI-header-files safe for C++-compiler |
| Дата | |
| Msg-id | 1183011990.6094.28.camel@goldbach обсуждение исходный текст |
| Ответ на | Re: SPI-header-files safe for C++-compiler (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-patches |
On Thu, 2007-28-06 at 02:07 -0400, Tom Lane wrote:
> It was already pointed out upthread that wrapping the inclusions in
> extern "C" {...} would fix the identifier part of the problem from
> the user side
No, my point about extern "C" was that I don't think we need to add it
to the Postgres headers. As far as I can see, it doesn't help with the
identifier part of the problem:
% cat foo.cpp
extern "C" {
#include "postgres.h"
#include "commands/trigger.h"
}
int
main(void)
{
return 0;
}
% g++ -I$HOME/postgres/head/prefix/include/server foo.cpp
/home/neilc/postgres/head/prefix/include/server/nodes/primnodes.h:1078:
error: expected unqualified-id before 'using'
/home/neilc/postgres/head/prefix/include/server/nodes/primnodes.h:1078:
error: abstract declarator 'List*' used as declaration
/home/neilc/postgres/head/prefix/include/server/nodes/primnodes.h:1078:
error: expected ';' before 'using'
/home/neilc/postgres/head/prefix/include/server/nodes/parsenodes.h:167:
error: expected unqualified-id before 'typeid'
/home/neilc/postgres/head/prefix/include/server/nodes/parsenodes.h:238:
error: expected unqualified-id before 'typename'
[ ... and so on ... ]
-Neil
В списке pgsql-patches по дате отправления: