1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-05 07:21:24 +03:00

Make backend header files C++ safe

This alters various incidental uses of C++ key words to use other similar
identifiers, so that a C++ compiler won't choke outright.  You still
(probably) need extern "C" { }; around the inclusion of backend headers.

based on a patch by Kurt Harriman <harriman@acm.org>

Also add a script cpluspluscheck to check for C++ compatibility in the
future.  As of right now, this passes without error for me.
This commit is contained in:
Peter Eisentraut
2009-07-16 06:33:46 +00:00
parent 4ef8dc7a75
commit de160e2c00
52 changed files with 392 additions and 359 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_rewrite.c,v 1.14 2009/01/07 13:44:36 tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_rewrite.c,v 1.15 2009/07/16 06:33:44 petere Exp $
*
*-------------------------------------------------------------------------
*/
@ -57,7 +57,7 @@ findeq(QTNode *node, QTNode *ex, QTNode *subs, bool *isfind)
if (node->valnode->type == QI_OPR)
{
if (node->valnode->operator.oper != ex->valnode->operator.oper)
if (node->valnode->qoperator.oper != ex->valnode->qoperator.oper)
return node;
if (node->nchild == ex->nchild)
@ -154,7 +154,7 @@ findeq(QTNode *node, QTNode *ex, QTNode *subs, bool *isfind)
{
Assert(node->valnode->type == QI_VAL);
if (node->valnode->operand.valcrc != ex->valnode->operand.valcrc)
if (node->valnode->qoperand.valcrc != ex->valnode->qoperand.valcrc)
return node;
else if (QTNEq(node, ex))
{
@ -217,7 +217,7 @@ dropvoidsubtree(QTNode *root)
root->nchild = j;
if (root->valnode->operator.oper == OP_NOT && root->nchild == 0)
if (root->valnode->qoperator.oper == OP_NOT && root->nchild == 0)
{
QTNFree(root);
root = NULL;