X-Original-To: pgsql-interfaces@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 283C1475E2C for ; Wed, 19 Feb 2003 18:31:25 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 80666-04 for ; Wed, 19 Feb 2003 18:31:12 -0500 (EST) Received: from gargoyle2.syscon-intl.com (ns.syscon-intl.com [63.237.63.226]) by postgresql.org (Postfix) with ESMTP id BF18E476043 for ; Wed, 19 Feb 2003 17:20:21 -0500 (EST) Received: from smtp.syscon-intl.com (root@smtp.syscon-intl.com [172.17.0.2]) by gargoyle2.syscon-intl.com (8.9.3/8.9.3) with ESMTP id RAA22059 for ; Wed, 19 Feb 2003 17:20:23 -0500 Received: from mikea (mikea.syscon-intl.com) by smtp.syscon-intl.com (8.8.5/8.8.5) with SMTP id RAA22200 for ; Wed, 19 Feb 2003 17:20:23 -0500 Message-Id: <200302192220.RAA22200@smtp.syscon-intl.com> X-Sender: mikea@pop3.syscon-intl.com X-Mailer: QUALCOMM Windows Eudora Pro Version 4.0.1 Date: Wed, 19 Feb 2003 17:24:45 +0000 To: pgsql-interfaces@postgresql.org From: Mike Alford Subject: ECPG include problem Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Virus-Scanned: by amavisd-new X-Archive-Number: 200302/84 X-Sequence-Number: 3705 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. 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; 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. */ In porting to psql I have #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 typedef char ComText_t[L_COM_TEXT]; to typedef char ComText_t[21]; /*value of L_COM_TEXT */ 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? I am a novice at postgres. Do not try to solve all life's problems at once -- learn to dread each day as it comes.