pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mike Alford <mikea@syscon-intl.com>
To: pgsql-interfaces@postgresql.org
Subject: ECPG include problem
Date: Wed, 19 Feb 2003 17:24:45 +0000
Message-ID: <200302192220.RAA22200@smtp.syscon-intl.com> (raw)

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 <db1.h>
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 <db1.h>
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.




view thread (5+ messages)  latest in thread

Message-ID: <200302192220.RAA22200@smtp.syscon-intl.com>
Permalink:  ../200302192220.RAA22200@smtp.syscon-intl.com/
Also on:    postgresql.org/message-id/200302192220.RAA22200@smtp.syscon-intl.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: mikea@syscon-intl.com
  Subject: Re: ECPG include problem
  In-Reply-To: <200302192220.RAA22200@smtp.syscon-intl.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox