Re: [PATCHES] Cygwin PostgreSQL ESQL Patch

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jason Tishler <Jason(dot)Tishler(at)dothill(dot)com>
Cc: Pgsql-Patches <pgsql-patches(at)postgresql(dot)org>, Pgsql-Cygwin <pgsql-cygwin(at)postgresql(dot)org>, Michael Lemke <lemkemch(at)t-online(dot)de>
Subject: Re: [PATCHES] Cygwin PostgreSQL ESQL Patch
Date: 2001-04-20 18:38:53
Message-ID: 27340.987791933@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-cygwin pgsql-patches

Jason Tishler <Jason(dot)Tishler(at)dothill(dot)com> writes:
>> --- why should sqlca.h define this symbol? What
>> happens if sqlca.h is included in a file that also includes other
>> Postgres includes, which will probably pull in c.h where the real
>> definition is?

> I never thought about this possibility -- I erroneously thought that
> sqlca.h was used by ESQL only.

AFAICT sqlca.h will be included by some (if not all) ecpg client
programs. I'm not sure whether we should expect that such clients
might also include other Postgres headers. However, sqlca.h is also
included by several modules of ecpg itself, which certainly do include
a ton of Postgres headers. So there is a distinct risk that this will
fail when using a compiler that complains about redefinition of macros.

> In the above mentioned URL, I suggested including c.h as another
> possibly better solution. However, I saw the following in ecpglib.h:
> /*
> * this is a small part of c.h since we don't want to leak all postgres
> * definitions into ecpg programs
> */
> so I decided against including c.h in the first version of my patch.

That's a fair point. Maybe it should be

+#ifndef DLLIMPORT
+#ifdef __CYGWIN__
+#define DLLIMPORT __declspec (dllimport)
+#else
+#define DLLIMPORT
+#endif /* __CYGWIN__ */
+#endif /* DLLIMPORT */

regards, tom lane

In response to

Responses

Browse pgsql-cygwin by date

  From Date Subject
Next Message Jason Tishler 2001-04-20 19:38:56 Re: [PATCHES] Cygwin PostgreSQL ESQL Patch
Previous Message Jason Tishler 2001-04-20 18:27:19 Re: [PATCHES] Cygwin PostgreSQL ESQL Patch

Browse pgsql-patches by date

  From Date Subject
Next Message Jason Tishler 2001-04-20 19:38:56 Re: [PATCHES] Cygwin PostgreSQL ESQL Patch
Previous Message Jason Tishler 2001-04-20 18:27:19 Re: [PATCHES] Cygwin PostgreSQL ESQL Patch