From de160e2c001fc77168ff1edc815ceeec0c6d4244 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 16 Jul 2009 06:33:46 +0000 Subject: 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 Also add a script cpluspluscheck to check for C++ compatibility in the future. As of right now, this passes without error for me. --- src/backend/utils/adt/tsrank.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/backend/utils/adt/tsrank.c') diff --git a/src/backend/utils/adt/tsrank.c b/src/backend/utils/adt/tsrank.c index 3dac5ce0cd..65c7e6fa81 100644 --- a/src/backend/utils/adt/tsrank.c +++ b/src/backend/utils/adt/tsrank.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/tsrank.c,v 1.15 2009/06/11 14:49:04 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/tsrank.c,v 1.16 2009/07/16 06:33:44 petere Exp $ * *------------------------------------------------------------------------- */ @@ -358,7 +358,7 @@ calc_rank(float *w, TSVector t, TSQuery q, int4 method) return 0.0; /* XXX: What about NOT? */ - res = (item->type == QI_OPR && item->operator.oper == OP_AND) ? + res = (item->type == QI_OPR && item->qoperator.oper == OP_AND) ? calc_rank_and(w, t, q) : calc_rank_or(w, t, q); if (res < 0) @@ -641,7 +641,7 @@ get_docrep(TSVector txt, QueryRepresentation *qr, int *doclen) if (item[i].type != QI_VAL) continue; - curoperand = &item[i].operand; + curoperand = &item[i].qoperand; if (QR_GET_OPERAND_EXISTS(qr, &item[i])) continue; @@ -680,8 +680,8 @@ get_docrep(TSVector txt, QueryRepresentation *qr, int *doclen) for (k = 0; k < qr->query->size; k++) { - QueryOperand *kptr = &item[k].operand; - QueryOperand *iptr = &item[i].operand; + QueryOperand *kptr = &item[k].qoperand; + QueryOperand *iptr = &item[i].qoperand; if (k == i || (item[k].type == QI_VAL && -- cgit v1.2.1