From: Michael Meskes <meskes@postgresql.org>
To: Matthew Vanecek <mevanecek@yahoo.com>
Cc: Michael Meskes <meskes@postgresql.org>
Cc: Postgresql Interfaces List <pgsql-interfaces@postgresql.org>
Subject: Re: ECPG and C++ compilation
Date: Wed, 26 Feb 2003 16:33:43 +0100
Message-ID: <20030226153343.GA26887@feivel.fam-meskes.de> (raw)
In-Reply-To: <1046205884.12260.77.camel@reliant.home.pri>
References: <NDBBLJPIEGAHHANHMMBBEEOGCNAA.dpant@intracom.gr>
<1045926883.27169.76.camel@reliant.home.pri>
<20030224152458.GA2980@feivel.fam-meskes.de>
<1046205884.12260.77.camel@reliant.home.pri>
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!
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-interfaces@postgresql.org
Cc: meskes@postgresql.org, mevanecek@yahoo.com
Subject: Re: ECPG and C++ compilation
In-Reply-To: <20030226153343.GA26887@feivel.fam-meskes.de>
* 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