Re: ECPG and C++ compilation

From: Michael Meskes <meskes(at)postgresql(dot)org>
To: Matthew Vanecek <mevanecek(at)yahoo(dot)com>
Cc: Michael Meskes <meskes(at)postgresql(dot)org>, Postgresql Interfaces List <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: ECPG and C++ compilation
Date: 2003-02-26 15:33:43
Message-ID: 20030226153343.GA26887@feivel.fam-meskes.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)Fam-Meskes(dot)De
ICQ: 179140304
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Michael Meskes 2003-02-26 15:38:43 Re: Using LISTEN/NOTIFY with ecpg
Previous Message D'Arcy J.M. Cain 2003-02-26 13:57:07 Re: Python interface and Money?