This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: help with bash/readline dll interaction bug


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.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]