Re: [PATCHES] Cygwin PostgreSQL ESQL Patch - Mailing list pgsql-cygwin

From Tom Lane
Subject Re: [PATCHES] Cygwin PostgreSQL ESQL Patch
Date
Msg-id 27340.987791933@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCHES] Cygwin PostgreSQL ESQL Patch  (Jason Tishler <Jason.Tishler@dothill.com>)
Responses Re: [PATCHES] Cygwin PostgreSQL ESQL Patch
List pgsql-cygwin
Jason Tishler <Jason.Tishler@dothill.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

pgsql-cygwin by date:

Previous
From: Jason Tishler
Date:
Subject: Re: [PATCHES] Cygwin PostgreSQL ESQL Patch
Next
From: Jason Tishler
Date:
Subject: Re: [PATCHES] Cygwin PostgreSQL ESQL Patch