Re: ECPG and C++ compilation - Mailing list pgsql-interfaces

From Michael Meskes
Subject Re: ECPG and C++ compilation
Date
Msg-id 20030226153343.GA26887@feivel.fam-meskes.de
Whole thread Raw
In response to Re: ECPG and C++ compilation  (Matthew Vanecek <mevanecek@yahoo.com>)
List pgsql-interfaces
On Tue, Feb 25, 2003 at 02:44:45PM -0600, Matthew Vanecek wrote:
> EXEC SQL BEGIN DECLARE SECTION;
> struct s_somestruct {
>     int id;
>     char *field;
> };
>
> typedef struct s_somestruct SomeStruct;
> EXEC SQL END DECLARE SECTION;

Ah, now I understand. Yes, this is a long standing bug. Or make that a
missing feature. The struct definition has to be listed inside the typedef.

> Doing "typedef struct { /* stuff */ } AStruct;" appears to work with
> ecpg from 7.3.2, but IIRC, it would not work in 7.2.3.

I'm note sure what worked in 7.2.3. :-)

> Is sizeof() a compile-time execution/calculation?  If so, then it would

AFAIK yes.

> definitely not be portable, unless you implemented/used a generic types
> library (such as glib, for example).  Since it works in C, though, and
> ECPG generates C, I'm by no means making a suggestion to follow this
> path. ;)

Michael
--
Michael Meskes
Email: Michael@Fam-Meskes.De
ICQ: 179140304
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!


pgsql-interfaces by date:

Previous
From: "D'Arcy J.M. Cain"
Date:
Subject: Re: Python interface and Money?
Next
From: Michael Meskes
Date:
Subject: Re: Using LISTEN/NOTIFY with ecpg