pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: none none <mytofi@hotmail.com>
To: pgsql-sql@postgresql.org
Subject: include in both ecpg and C++
Date: Wed, 19 Jan 2005 17:03:52 -0500
Message-ID: <BAY16-F38F479548B365891BAC163CF800@phx.gbl> (raw)


I have a header file that gets included by both C/C++ code and ecpg code.  
In this header are a few structs that get used by both code (C/C++ and 
ecpg).  In order to get this to work for Informix, we had to do something 
like this in the header file:

#ifdef TFLG
EXEC SQL BEGIN DECLARE SECTION
#endif

struct definitions

#ifdef TFLG
EXEC SQL END DECLARE SECTION
#endif

I use the EXEC SQL INCLUDE headerfile statement in my ecpg code, but of 
course, not the C/C++ code.

I believe the TFLG macro gets defined by the Informix precompiler (though I 
have not been able to verify this).  I also have not been able to find any 
sort of PostGres counterpart.

I am using the Informix compatibility switch when compiling ecpg, but do not 
get a successful compile (with a number of compile variations attempted).  
Does anyone know how to implement such a design?  Is there a PostGres macro 
that is basically the same thing or is there another method I may be able to 
use?

Thanks,

Tom





Message-ID: <BAY16-F38F479548B365891BAC163CF800@phx.gbl>
Permalink:  ../BAY16-F38F479548B365891BAC163CF800@phx.gbl/
Also on:    postgresql.org/message-id/BAY16-F38F479548B365891BAC163CF800@phx.gbl

 · 

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-sql@postgresql.org
  Cc: mytofi@hotmail.com
  Subject: Re: include in both ecpg and C++
  In-Reply-To: <BAY16-F38F479548B365891BAC163CF800@phx.gbl>

* 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