X-Original-To: pgsql-interfaces@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id D9A50475AAC for ; Thu, 20 Feb 2003 21:23:47 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 86378-04 for ; Thu, 20 Feb 2003 21:23:37 -0500 (EST) Received: from crtntx1-ar11-4-62-011-208.crtntx1.dsl-verizon.net (crtntx1-ar11-4-62-009-178.crtntx1.dsl-verizon.net [4.62.9.178]) by postgresql.org (Postfix) with ESMTP id EF6E9475A71 for ; Thu, 20 Feb 2003 21:23:26 -0500 (EST) Received: from reliant.home.pri (reliant.home.pri [192.168.1.25]) by crtntx1-ar11-4-62-011-208.crtntx1.dsl-verizon.net (Postfix) with ESMTP id DBD6D3018; Thu, 20 Feb 2003 20:23:49 -0600 (CST) Subject: Re: ECPG include problem From: Matthew Vanecek To: Mike Alford Cc: Postgresql Interfaces List In-Reply-To: <200302192220.RAA22200@smtp.syscon-intl.com> References: <200302192220.RAA22200@smtp.syscon-intl.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-b99PUGNAgn6CvLUB5rNU" Organization: Message-Id: <1045794208.27174.13.camel@reliant.home.pri> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 20 Feb 2003 20:23:29 -0600 X-Virus-Scanned: by amavisd-new X-Archive-Number: 200302/91 X-Sequence-Number: 3712 --=-b99PUGNAgn6CvLUB5rNU Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Wed, 2003-02-19 at 11:24, Mike Alford wrote: > I am trying to compile an application developed on SCO Unix with an Ingres > 1.2 database that uses embedded sql. I am having a problem with the > included files.=20 > This code appears in the embedded sql in Ingres: > #include > EXEC SQL INCLUDE SQLCA; > EXEC SQL BEGIN DECLARE SECTION; > EXEC SQL INCLUDE '../include/db2.h'; > EXEC SQL END DECLARE SECTION; >=20 > The ../include/db2.h file contains lines like > typedef char ComText_t[L_COM_TEXT]; > that are defined in db1.h > #define L_COM_TEXT 21 /* Length of pvdef text com parameter. > */ >=20 > In porting to psql I have=20 > #include > EXEC SQL INCLUDE sqlca; > EXEC SQL BEGIN DECLARE SECTION; > EXEC SQL INCLUDE ../include/db2; > EXEC SQL END DECLARE SECTION; > but receive the error > ../include/db2.h:28: ERROR: parse error at or near "L_COM_TEXT" > If I change=20 > typedef char ComText_t[L_COM_TEXT]; to=20 > typedef char ComText_t[21]; /*value of L_COM_TEXT */=20 > everything is fine. Apparently the preprocessing that Ingres did is not > happening in Postgres. There are over 2000 lines in db2.h, mostly with > constants defined in db1.h. Is there something simple I am overlooking, or > an option to epcg that could allow db2.h to be preprocessed before it is > included? >=20 > I am a novice at postgres. To the best of my knowledge, there is no such option. You may want to try running db2.h through cpp prior to running ecpg. For best results, you would not want any other headers included--just db1.h and db2.h. --=20 Matthew Vanecek perl -e 'print $i=3Dpack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);' ***************************************************************************= ***** For 93 million miles, there is nothing between the sun and my shadow except= me. I'm always getting in the way of something... --=-b99PUGNAgn6CvLUB5rNU Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQA+VY2gi/CNzDSN0RIRAod6AJwIrFXlxKrjRqwMTM5y5DsZ0lUuWQCghPTm KX6ZOBuNHYej4TsyTVGb7Ek= =I237 -----END PGP SIGNATURE----- --=-b99PUGNAgn6CvLUB5rNU--