diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2009-07-16 06:33:46 +0000 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2009-07-16 06:33:46 +0000 |
commit | de160e2c001fc77168ff1edc815ceeec0c6d4244 (patch) | |
tree | 15afc931e1e23706b8916619581ddd5c0bcedcee /src/backend/parser/parse_utilcmd.c | |
parent | 4ef8dc7a75a9a408b34338854dd0d412ea01c504 (diff) | |
download | postgresql-de160e2c001fc77168ff1edc815ceeec0c6d4244.tar.gz postgresql-de160e2c001fc77168ff1edc815ceeec0c6d4244.zip |
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.
Diffstat (limited to 'src/backend/parser/parse_utilcmd.c')
-rw-r--r-- | src/backend/parser/parse_utilcmd.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index 0c93f58c173..a5d805aa98b 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -19,7 +19,7 @@ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/backend/parser/parse_utilcmd.c,v 2.22 2009/07/12 17:12:34 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/parser/parse_utilcmd.c,v 2.23 2009/07/16 06:33:43 petere Exp $ * *------------------------------------------------------------------------- */ @@ -266,24 +266,24 @@ transformColumnDefinition(ParseState *pstate, CreateStmtContext *cxt, /* Check for SERIAL pseudo-types */ is_serial = false; - if (list_length(column->typename->names) == 1 && - !column->typename->pct_type) + if (list_length(column->typeName->names) == 1 && + !column->typeName->pct_type) { - char *typname = strVal(linitial(column->typename->names)); + char *typname = strVal(linitial(column->typeName->names)); if (strcmp(typname, "serial") == 0 || strcmp(typname, "serial4") == 0) { is_serial = true; - column->typename->names = NIL; - column->typename->typeid = INT4OID; + column->typeName->names = NIL; + column->typeName->typeOid = INT4OID; } else if (strcmp(typname, "bigserial") == 0 || strcmp(typname, "serial8") == 0) { is_serial = true; - column->typename->names = NIL; - column->typename->typeid = INT8OID; + column->typeName->names = NIL; + column->typeName->typeOid = INT8OID; } /* @@ -291,7 +291,7 @@ transformColumnDefinition(ParseState *pstate, CreateStmtContext *cxt, * typeid, LookupTypeName won't notice arrayBounds. We don't need any * special coding for serial(typmod) though. */ - if (is_serial && column->typename->arrayBounds != NIL) + if (is_serial && column->typeName->arrayBounds != NIL) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("array of serial is not implemented"))); @@ -382,7 +382,7 @@ transformColumnDefinition(ParseState *pstate, CreateStmtContext *cxt, snamenode->val.val.str = qstring; snamenode->location = -1; castnode = makeNode(TypeCast); - castnode->typename = SystemTypeName("regclass"); + castnode->typeName = SystemTypeName("regclass"); castnode->arg = (Node *) snamenode; castnode->location = -1; funccallnode = makeNode(FuncCall); @@ -623,7 +623,7 @@ transformInhRelation(ParseState *pstate, CreateStmtContext *cxt, */ def = makeNode(ColumnDef); def->colname = pstrdup(attributeName); - def->typename = makeTypeNameFromOid(attribute->atttypid, + def->typeName = makeTypeNameFromOid(attribute->atttypid, attribute->atttypmod); def->inhcount = 0; def->is_local = true; @@ -1969,7 +1969,7 @@ transformColumnType(ParseState *pstate, ColumnDef *column) /* * All we really need to do here is verify that the type is valid. */ - Type ctype = typenameType(pstate, column->typename, NULL); + Type ctype = typenameType(pstate, column->typeName, NULL); ReleaseSysCache(ctype); } |