delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/05/13/07:17:30

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT 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 AT yahoo DOT co DOT nz>
Subject: Re: function pointers & DLL's
To: Andrej Borsenkow <Andrej DOT Borsenkow AT mow DOT siemens DOT ru>
Cc: cygwin AT cygwin DOT com
In-Reply-To: <Pine.SV4.4.33.0105131338230.23635-100000@itsrm2.mow.siemens.ru>
MIME-Version: 1.0

--- Andrej Borsenkow <Andrej DOT Borsenkow AT mow DOT siemens DOT 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019