This is the mail archive of the cygwin@cygwin.com 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]

AW: function pointers & DLL's


> -----Ursprüngliche Nachricht-----
> Von: cygwin-owner@sources.redhat.com
> [mailto:cygwin-owner@sources.redhat.com]Im Auftrag von Andrej Borsenkow
> Gesendet am: Sonntag, 13. Mai 2001 11:43
> An: Jesper Eskilson
> Cc: Alan Hourihane; cygwin@cygwin.com
> 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: Ralf@habacker.de
       Ralf.Habacker@saght.tessag.com

dll.c

Makefile

client.c

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

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