Re: YA readline 4.2 patch - Mailing list pgsql-patches

From Jason Tishler
Subject Re: YA readline 4.2 patch
Date
Msg-id 20010606143824.J524@dothill.com
Whole thread Raw
In response to Re: YA readline 4.2 patch  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Tom,

On Wed, Jun 06, 2001 at 02:08:21PM -0400, Tom Lane wrote:
> Jason Tishler <Jason.Tishler@dothill.com> writes:
> >> I'm confused.  The current code already builds cleanly against readline
> >> 4.2.  Why do we need to change it?
>
> > 1.  The current code does *not* build cleanly against readline 4.2
> > under Cygwin.
>
> Why not?  It builds cleanly for me, under gcc.  I don't understand why
> Cygwin would be different.

I thought that we have been here before...

Remember that DLLs under Windows are *not* the same as shared libraries
under UNIX.

In order for Cygwin PostgreSQL to link cleanly against Cygwin readline
(which is DLL), the functions imported must be decorated with:

    __declspec(dllimport)

So, declaring filename_completion_function() with:

    extern char *filename_completion_function();

is not sufficient.  Instead, it must be declared as follows:

    extern __declspec(dllimport) char *filename_completion_function(const char *, int);

My patch accomplishes the above (without affecting other platforms),
but conditionally uses filename_completion_function() or
rl_filename_completion_function() as appropriate.

Jason

--
Jason Tishler
Director, Software Engineering       Phone: 732.264.8770 x235
Dot Hill Systems Corp.               Fax:   732.264.8798
82 Bethany Road, Suite 7             Email: Jason.Tishler@dothill.com
Hazlet, NJ 07730 USA                 WWW:   http://www.dothill.com

pgsql-patches by date:

Previous
From: Jan Wieck
Date:
Subject: Re: Patch for cursors with multiple parameters
Next
From: Bruce Momjian
Date:
Subject: Finalize large object patch