Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0460f05

Browse files
committed
I am attempting to integrate postgres (v 7.0) with an open source
project I am working on (Recall - a distributed, fault-tolerant,replicated, storage framework @http://www.fault-tolerant.org).Recall is written in C++. I need to include the postgres headers andthere are some problems when including the headers w/C++.Attached is a patch generated from postgres/src that fixes my problems.I was hoping to get this into the main source. It's very small (2k) and3 files are changed: backend/utils/fmgr/fmgr.c,backend/utils/Gen_fmgrtab.sh.in, and include/access/tupdesc.h.In C++, you get a multiply defined symbol because the variable(FmgrInfo *fmgr_pl_finfo) is defined in the header (the patch moves itto the .c file). The other problem in tupdesc.h is the use of typeidis a problem in c++ (I renamed it to oidtypeid).Thanks,Neal Norwitz
1 parent1f0aff0 commit0460f05

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

‎src/backend/access/common/tupdesc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.62 2000/04/12 17:14:37 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.63 2000/05/22 02:34:20 momjian Exp $
1212
*
1313
* NOTES
1414
* some of the executor utility code such as "ExecTypeFromTL" should be
@@ -304,7 +304,7 @@ bool
304304
TupleDescInitEntry(TupleDescdesc,
305305
AttrNumberattributeNumber,
306306
char*attributeName,
307-
Oidtypeid,
307+
Oidoidtypeid,
308308
int32typmod,
309309
intattdim,
310310
boolattisset)
@@ -378,7 +378,7 @@ TupleDescInitEntry(TupleDesc desc,
378378
* ----------------
379379
*/
380380
tuple=SearchSysCacheTuple(TYPEOID,
381-
ObjectIdGetDatum(typeid),
381+
ObjectIdGetDatum(oidtypeid),
382382
0,0,0);
383383
if (!HeapTupleIsValid(tuple))
384384
{
@@ -431,7 +431,7 @@ TupleDescInitEntry(TupleDesc desc,
431431
*/
432432
if (attisset)
433433
{
434-
Typet=typeidType(OIDOID);
434+
Typet=oidtypeidType(OIDOID);
435435

436436
att->attlen=typeLen(t);
437437
att->attbyval=typeByVal(t);

‎src/backend/utils/Gen_fmgrtab.sh.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#
99
#
1010
# IDENTIFICATION
11-
# $Header: /cvsroot/pgsql/src/backend/utils/Attic/Gen_fmgrtab.sh.in,v 1.20 2000/05/16 02:14:14 tgl Exp $
11+
# $Header: /cvsroot/pgsql/src/backend/utils/Attic/Gen_fmgrtab.sh.in,v 1.21 2000/05/22 02:34:21 momjian Exp $
1212
#
1313
# NOTES
1414
# Passes any -D options on to cpp prior to generating the list
@@ -83,7 +83,7 @@ cat > $HFILE <<FuNkYfMgRsTuFf
8383
*
8484
* Copyright (c) 1994, Regents of the University of California
8585
*
86-
*$Id: Gen_fmgrtab.sh.in,v 1.20 2000/05/16 02:14:14 tgl Exp $
86+
*$Id: Gen_fmgrtab.sh.in,v 1.21 2000/05/22 02:34:21 momjian Exp $
8787
*
8888
* NOTES
8989
*******************************
@@ -136,7 +136,7 @@ extern void load_file(char *filename);
136136
*/
137137
138138
/* We don't make this static so fmgr_faddr() macros can access it */
139-
FmgrInfo *fmgr_pl_finfo;
139+
externFmgrInfo *fmgr_pl_finfo;
140140
141141
#define fmgr_faddr(finfo)\
142142
(\
@@ -197,7 +197,7 @@ cat > $TABCFILE <<FuNkYfMgRtAbStUfF
197197
*
198198
*
199199
* IDENTIFICATION
200-
*$Header: /cvsroot/pgsql/src/backend/utils/Attic/Gen_fmgrtab.sh.in,v 1.20 2000/05/16 02:14:14 tgl Exp $
200+
*$Header: /cvsroot/pgsql/src/backend/utils/Attic/Gen_fmgrtab.sh.in,v 1.21 2000/05/22 02:34:21 momjian Exp $
201201
*
202202
* NOTES
203203
*

‎src/backend/utils/fmgr/fmgr.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/fmgr.c,v 1.38 2000/05/16 20:48:50 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/fmgr.c,v 1.39 2000/05/22 02:34:22 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -28,6 +28,7 @@
2828
*
2929
* XXX: use of global fmgr_pl_finfo variable is really ugly. FIXME
3030
*/
31+
FmgrInfo*fmgr_pl_finfo;
3132

3233
staticchar*
3334
fmgr_pl(char*arg0,...)

‎src/include/access/tupdesc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: tupdesc.h,v 1.28 2000/04/12 17:16:26 momjian Exp $
10+
* $Id: tupdesc.h,v 1.29 2000/05/22 02:34:23 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -68,7 +68,7 @@ extern bool equalTupleDescs(TupleDesc tupdesc1, TupleDesc tupdesc2);
6868
externboolTupleDescInitEntry(TupleDescdesc,
6969
AttrNumberattributeNumber,
7070
char*attributeName,
71-
Oidtypeid,
71+
Oidoidtypeid,
7272
int32typmod,
7373
intattdim,
7474
boolattisset);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp