include in both ecpg and C++ - Mailing list pgsql-sql

From none none
Subject include in both ecpg and C++
Date
Msg-id BAY16-F38F479548B365891BAC163CF800@phx.gbl
Whole thread Raw
List pgsql-sql
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




pgsql-sql by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Returning a bool on DELETE in a proc.
Next
From: Michael Fuhr
Date:
Subject: Re: ERROR: row is too big: size 9856, maximum size 8136