Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
Message-ID: <20010513111651.20656.qmail@web6405.mail.yahoo.com>
Date: Sun, 13 May 2001 21:16:51 +1000 (EST)
From: =?iso-8859-1?q?Danny=20Smith?= <danny_r_smith_2001@yahoo.co.nz>
Subject: Re: function pointers & DLL's
To: Andrej Borsenkow <Andrej.Borsenkow@mow.siemens.ru>
Cc: cygwin@cygwin.com
In-Reply-To: <Pine.SV4.4.33.0105131338230.23635-100000@itsrm2.mow.siemens.ru>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit


--- Andrej Borsenkow <Andrej.Borsenkow@mow.siemens.ru> wrote: > On Sun, 13 May
2001, Jesper Eskilson wrote:
> 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
> 
> extern __declspec(dllimport) foo();
> 
> static dispatch tbl = {
>    ...
>    foo,
>    ...
> }
> 
> That is clear, because __declspec(dllimport) basically replaces any
> reference to an object by a thunk that returns object's address.
> 
> -andrej
> 
> 


Yes, and this is relevant to an apparent bug I reported earlier (with a
suggested fix) regarding static const initialisation in imported C++ classes. 

http://sources.redhat.com/ml/cygwin/2001-03/msg01706.html

 Static const members (whether they are initialised inline or not) "inherit"
the __declspec(dllimport) status of their class.  If they are initialised
inline the automatic use of context to mark as dllimport causes a failure later
on when gcc says no, no you can't import initialised objects. 


Danny

_____________________________________________________________________________
http://messenger.yahoo.com.au - Yahoo! Messenger
- Voice chat, mail alerts, stock quotes and favourite news and lots more!

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

