AW: function pointers & DLL's

Ralf Habacker Ralf.Habacker@saght.tessag.com
Mon May 14 06:26:00 GMT 2001


> -----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 2001年5月13日, 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: client.c
Type: text/x-c
Size: 775 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20010514/cc2c377d/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dll.c
Type: text/x-c
Size: 196 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20010514/cc2c377d/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: text/x-makefile
Size: 231 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20010514/cc2c377d/attachment-0002.bin>


More information about the Cygwin mailing list

AltStyle によって変換されたページ (->オリジナル) /