mcxt.h

Started by J.M.almost 27 years ago3 messages
#1J.M.
darcy@druid.net

I tried to create a new user-defined type. I use palloc() to create
storage for this type so I include palloc.h however, this generates
the following error.

[postgres@druid:contrib/chkpass] $ make
cc -g -O -fPIC -I/usr/local/pgsql/include -c chkpass.c
In file included from /usr/local/pgsql/include/postgres.h:44,
from chkpass.c:9:
/usr/local/pgsql/include/utils/palloc.h:30: utils/mcxt.h: No such file or directory

If I copy mcxt.h there I get this error.

[postgres@druid:contrib/chkpass] $ make
cc -g -O -fPIC -I/usr/local/pgsql/include -c chkpass.c
In file included from /usr/local/pgsql/include/utils/palloc.h:30,
from /usr/local/pgsql/include/postgres.h:44,
from chkpass.c:9:
/usr/local/pgsql/include/utils/mcxt.h:25: syntax error before `MemoryContext'

If I remove the include from palloc.h I have problems with the use of
palloc because the macro expands to use CurrentMemoryContext which is
declared in mcxt.h. Anyone know what the correct answer to this problem
might be?

-- 
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 424 2871     (DoD#0082)    (eNTP)   |  what's for dinner.
#2Horak Daniel
horak@mmp.plzen-city.cz
In reply to: J.M. (#1)
RE: [HACKERS] mcxt.h

If I copy mcxt.h there I get this error.

[postgres@druid:contrib/chkpass] $ make
cc -g -O -fPIC -I/usr/local/pgsql/include -c chkpass.c
In file included from /usr/local/pgsql/include/utils/palloc.h:30,
from /usr/local/pgsql/include/postgres.h:44,
from chkpass.c:9:
/usr/local/pgsql/include/utils/mcxt.h:25: syntax error before
`MemoryContext'

This can be caused by the DLLIMPORT symbol in declaration of
CurrentMemoryContext in mcxt.h. DLLIMPORT is defined in c.h as nothing for
all platforms other than win32 (I hope) and c.h is included by postgres.h.

Dan

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Horak Daniel (#2)
Re: [HACKERS] mcxt.h

How long since you updated your source code? I took care of this
a couple weeks ago ... or so I thought ...

You do need to repeat the "make install" step to get the right stuff
put into /usr/local/pgsql/include/.

regards, tom lane