help with bash/readline dll interaction bug

Brian Dessent brian@dessent.net
Thu Nov 20 10:18:00 GMT 2008


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/



More information about the Cygwin mailing list