Subject: AW: function pointers & DLL's
From: "Ralf Habacker" <[email-masked]>
To: "Cygwin" <[email-masked]>
Cc: "Andrej Borsenkow" <[email-masked]>
Date: Mon, 14 May 2001 15:22:19 +0200

> -----Ursprüngliche Nachricht-----
> Von: [email-masked]
> [mailto:[email-masked]]Im Auftrag von Andrej Borsenkow
> Gesendet am: Sonntag, 13. Mai 2001 11:43
> An: Jesper Eskilson
> Cc: Alan Hourihane; [email-masked]
> Betreff: Re: function pointers & DLL's
>
> On Sun, 13 May 2001, Jesper Eskilson wrote:
>
> > On Sun, 6 May 2001, Alan Hourihane wrote:
> >
> > > Everything works fine. But what I'm trying to do is find a
> way at the linker
> > > stage that negates me having to make these __declspec
> statements. Is there
> > > any way this is possible ?
> >
> > For VC++ (at least) __declspec(dllimport) is purely optional and never
> > required. The only this they do is to enable the compiler to skip an
> > indirection in the jump and generate a slightly more efficient jump.
> >
>
> For GCC (at least :-) __declspec(dllimport) is optional for functions but
> is mandatory for variables. The side-effect of the above is, that function
> address is no more static and cannot be used as static initializer, e.g.
> in function dispatch table like
>
That's not right. Paul Sokolvsky has written an ld patch named auto-import
initial for mingw, which is adapted to cygwin. Look into the appended files.
If you like, you can have this patched ld by mail and try it out.

Regards

Ralf Habacker
EMail: [email-masked]
       [email-masked]
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple