Tom,
On Fri, Apr 20, 2001 at 12:43:30PM -0400, Tom Lane wrote:
> Jason Tishler <Jason.Tishler@dothill.com> writes:
> > --- include/sqlca.h 2001/03/22 06:16:20 1.16
> > +++ include/sqlca.h 2001/04/20 14:15:01
> > @@ -1,6 +1,12 @@
> > #ifndef POSTGRES_SQLCA_H
> > #define POSTGRES_SQLCA_H
>
> > +#ifdef __CYGWIN__
> > +#define DLLIMPORT __declspec (dllimport)
> > +#else
> > +#define DLLIMPORT
> > +#endif /* __CYGWIN__ */
> > +
> > #define SQLERRMC_LEN 70
>
> This seems rather bad
Sorry, but I *did* try to start a discussion to determine the best way
to resolve this issue. See the following for details:
http://postgresql.readysetnet.com/mhonarc/pgsql-cygwin/2001-04/msg00004.html
Since no one responded, I took my best WAG.
> --- 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.
> I'd suggest adding
>
> #include "postgres_ext.h"
> #include "c.h"
>
> instead, which may be more namespace pollution than we'd like, but
> at least it does not create a potential definition conflict.
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.
Nevertheless, I appreciate your guidance and I will redo my patch as
you suggested.
Thanks,
Jason
--
Jason Tishler
Director, Software Engineering Phone: +1 (732) 264-8770 x235
Dot Hill Systems Corp. Fax: +1 (732) 264-8798
82 Bethany Road, Suite 7 Email: Jason.Tishler@dothill.com
Hazlet, NJ 07730 USA WWW: http://www.dothill.com