Skip site navigation (1) Skip section navigation (2)

Re: [PATCHES] Cygwin PostgreSQL ESQL Patch

From: Jason Tishler <Jason(dot)Tishler(at)dothill(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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:27:19
Message-ID: 20010420142719.I294@dothill.com (view raw or flat)
Thread:
Lists: pgsql-cygwinpgsql-patches
Tom,

On Fri, Apr 20, 2001 at 12:43:30PM -0400, Tom Lane wrote:
> Jason Tishler <Jason(dot)Tishler(at)dothill(dot)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(dot)Tishler(at)dothill(dot)com
Hazlet, NJ 07730 USA                 WWW:   http://www.dothill.com

In response to

Responses

pgsql-cygwin by date

Next:From: Tom LaneDate: 2001-04-20 18:38:53
Subject: Re: [PATCHES] Cygwin PostgreSQL ESQL Patch
Previous:From: Tom LaneDate: 2001-04-20 16:43:30
Subject: Re: [PATCHES] Cygwin PostgreSQL ESQL Patch

pgsql-patches by date

Next:From: Tom LaneDate: 2001-04-20 18:38:53
Subject: Re: [PATCHES] Cygwin PostgreSQL ESQL Patch
Previous:From: Tom LaneDate: 2001-04-20 16:43:30
Subject: Re: [PATCHES] Cygwin PostgreSQL ESQL Patch

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group