This is the mail archive of the
mailing list for the Cygwin project.
Re: help with bash/readline dll interaction bug
- From: Brian Dessent <brian at dessent dot net>
- To: cygwin at cygwin dot com
- Date: Wed, 19 Nov 2008 20:24:50 -0800
- Subject: Re: help with bash/readline dll interaction bug
- References: <4924E120.email@example.com>
- Reply-to: cygwin at cygwin dot com
Eric Blake wrote:
> Is there
> some slick way to make bash grab a function pointer that can see through
> the trampoline and see that bash's trampoline version of rl_tab_insert is
> indeed the same function as readline's local rl_tab_insert?
Sure, arrange for there to be a __declspec(dllimport) on rl_tab_insert's
prototype when its header is used in bash (but not when it's used in
building readline itself.) When you use explicit dllimport there's no
need for the thunk and thus function pointers will compare as expected.
The thunk stub is really a crutch that dates back eons ago to a time
when support in compilers for DLLs was still new, as a way to let people
link to DLLs with old compilers that didn't yet support the __declspec
keyword. The fact that it is also handy for porting *nix code that
doesn't traditionally use __declspec is a convenient coincidence.
> Would using
> gcc-4 have any impact on this?
Not that I am aware of.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html