include in both ecpg and C++

From: "none none" <mytofi(at)hotmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: include in both ecpg and C++
Date: 2005-01-19 22:03:52
Message-ID: BAY16-F38F479548B365891BAC163CF800@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Fuhr 2005-01-20 03:01:13 Re: ERROR: row is too big: size 9856, maximum size 8136
Previous Message Michael Fuhr 2005-01-19 21:35:21 Re: Returning a bool on DELETE in a proc.