1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +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_op.c,v 1.6 2009/06/11 14:49:04 momjian Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_op.c,v 1.7 2009/07/16 06:33:44 petere Exp $
*
*-------------------------------------------------------------------------
*/
@ -38,7 +38,7 @@ join_tsqueries(TSQuery a, TSQuery b, int8 operator)
res->valnode = (QueryItem *) palloc0(sizeof(QueryItem));
res->valnode->type = QI_OPR;
res->valnode->operator.oper = operator;
res->valnode->qoperator.oper = operator;
res->child = (QTNode **) palloc0(sizeof(QTNode *) * 2);
res->child[0] = QT2QTN(GETQUERY(b), GETOPERAND(b));
@ -124,7 +124,7 @@ tsquery_not(PG_FUNCTION_ARGS)
res->valnode = (QueryItem *) palloc0(sizeof(QueryItem));
res->valnode->type = QI_OPR;
res->valnode->operator.oper = OP_NOT;
res->valnode->qoperator.oper = OP_NOT;
res->child = (QTNode **) palloc0(sizeof(QTNode *));
res->child[0] = QT2QTN(GETQUERY(a), GETOPERAND(a));
@ -209,7 +209,7 @@ makeTSQuerySign(TSQuery a)
for (i = 0; i < a->size; i++)
{
if (ptr->type == QI_VAL)
sign |= ((TSQuerySign) 1) << (ptr->operand.valcrc % TSQS_SIGLEN);
sign |= ((TSQuerySign) 1) << (ptr->qoperand.valcrc % TSQS_SIGLEN);
ptr++;
}
@ -255,7 +255,7 @@ tsq_mcontains(PG_FUNCTION_ARGS)
if (ie[i].type != QI_VAL)
continue;
for (j = 0; j < query->size; j++)
if (iq[j].type == QI_VAL && ie[i].operand.valcrc == iq[j].operand.valcrc)
if (iq[j].type == QI_VAL && ie[i].qoperand.valcrc == iq[j].qoperand.valcrc)
{
j = query->size + 1;
break;